TetrisBot: Split DefaultShapes from IsValid method.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user