UTests pass with Pathfinder2D

This commit is contained in:
2021-02-28 07:52:28 -06:00
parent 715b328ef5
commit f55716d2ec
24 changed files with 687 additions and 294 deletions

View File

@@ -1,9 +1,11 @@
using System.Diagnostics;
using PathFinding;
using System.Collections.Generic;
using System.Diagnostics;
namespace Gameboard.ShogiUI.BoardState
{
[DebuggerDisplay("{WhichPiece} {Owner}")]
public class Piece
public abstract class Piece : IPlanarElement
{
public WhichPiece WhichPiece { get; }
public WhichPlayer Owner { get; private set; }
@@ -48,7 +50,7 @@ namespace Gameboard.ShogiUI.BoardState
: WhichPlayer.Player1;
}
public void Promote() => IsPromoted = true;
public void Promote() => IsPromoted = CanPromote;
public void Demote() => IsPromoted = false;
@@ -57,5 +59,11 @@ namespace Gameboard.ShogiUI.BoardState
ToggleOwnership();
Demote();
}
public abstract ICollection<Path> GetPaths();
public abstract Piece DeepClone();
public bool IsUpsideDown => Owner == WhichPlayer.Player2;
}
}