Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public void Execute(PotentialMove move)
        {
            var simulator = MoveSimulator.FromPotentialMove(board, move, NextPieceIfPlaying(move));

            simulator.Simulate();
            var executedMove = simulator.GetMove();

            Execute(executedMove);
        }
Ejemplo n.º 3
0
 internal bool Matches(PotentialMove other)
 {
     return(coord.Matches(other.coord) && orientation == other.orientation);
 }
Ejemplo n.º 4
0
        public Piece NextPieceIfPlaying(PotentialMove move)
        {
            var playedCoord = board.TransportCoord(move.coord, move.orientation);

            return(NextPieceIfPlaying(playedCoord));
        }