public static MoveSimulator FromPotentialMove(Board board, PotentialMove move, Piece nextPiece) { var newBoard = board.Clone(); newBoard.RotateTo(move.orientation); return(new MoveSimulator(newBoard, move.coord, nextPiece)); }
public void Execute(PotentialMove move) { var simulator = MoveSimulator.FromPotentialMove(board, move, NextPieceIfPlaying(move)); simulator.Simulate(); var executedMove = simulator.GetMove(); Execute(executedMove); }
internal bool Matches(PotentialMove other) { return(coord.Matches(other.coord) && orientation == other.orientation); }
public Piece NextPieceIfPlaying(PotentialMove move) { var playedCoord = board.TransportCoord(move.coord, move.orientation); return(NextPieceIfPlaying(playedCoord)); }