This commit is contained in:
2024-10-26 22:09:41 -05:00
parent 550942281b
commit f8bf967581
4 changed files with 107 additions and 53 deletions

View File

@@ -182,16 +182,6 @@ public class BoardState
return new MoveResult(true);
}
/// <summary>
/// Returns true if the given path can be traversed without colliding into a piece.
/// </summary>
public bool IsPathBlocked(IEnumerable<Vector2> path)
{
return !path.Any()
|| path.SkipLast(1).Any(position => this[position] != null)
|| this[path.Last()]?.Owner == WhoseTurn;
}
internal bool IsWithinPromotionZone(Vector2 position)
{
// TODO: Move this promotion zone logic into the StandardRules class.