checkpoint

This commit is contained in:
2022-06-07 20:29:04 -05:00
parent b3e0d154bd
commit 3a9a627e0d
8 changed files with 105 additions and 166 deletions

View File

@@ -55,6 +55,13 @@ namespace Shogi.Domain.Pieces
IsPromoted = false;
}
/// <summary>
/// Respecting the move-set of the Piece, collect all positions from start to end.
/// Useful if you need to iterate a move-set.
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns>An empty list if the piece cannot legally traverse from start to end. Otherwise, a list of positions.</returns>
public IEnumerable<Vector2> GetPathFromStartToEnd(Vector2 start, Vector2 end)
{
var steps = new List<Vector2>(10);