Ejemplo n.º 1
0
 MoveSimulator(Board board, Coord coord, Piece nextPiece)
 {
     this.board     = board;
     this.moveCoord = coord;
     this.oldPiece  = board.Get(coord);
     this.playLogic = new PlayLogic(board);
     this.nextPiece = nextPiece;
 }
Ejemplo n.º 2
0
        public IEnumerable <PotentialMove> AvailableMoves()
        {
            if (!board.IsFull())
            {
                Board.ThrowInvalidOp("Board must be full");
            }

            var clonedBoard = board.Clone();

            for (int i = 0; i < 4; i++)
            {
                var subLogic = new PlayLogic(clonedBoard);
                foreach (var move in subLogic.UnrotatedMoves())
                {
                    yield return(move);
                }

                clonedBoard.RotateRight();
            }
        }