TetrisBot: Split DefaultShapes from IsValid method.

This commit is contained in:
2019-11-08 02:09:44 +01:00
parent 87c5878ec9
commit c3c9bb88ab

View File

@@ -242,7 +242,9 @@ namespace VAR.ScreenAutomation.Bots
private static List<TetrisShape> _defaultShapes = null;
public bool IsValid()
public static List<TetrisShape> DefaultShapes
{
get
{
if (_defaultShapes == null)
{
@@ -348,9 +350,14 @@ namespace VAR.ScreenAutomation.Bots
})
};
}
return _defaultShapes;
}
}
public bool IsValid()
{
if (_count != 4) { return false; }
bool matchesAnyDefault = _defaultShapes.Any(ts => CompareShape(ts));
bool matchesAnyDefault = DefaultShapes.Any(ts => CompareShape(ts));
return matchesAnyDefault;
}