Пример #1
0
 public static Board deepCopy(Board b)
 {
     Board newB = new Board(b.getHeight(), b.getWidth());
     for (int y = 0; y < newB.getHeight(); y++) {
         for (int x = 0; x < newB.getWidth(); x++) {
             Piece p = b.getCellContents(y, x);
             if (p != null) {
                 newB.addPieceToCell(new Piece(p));
             }
         }
     }
     return newB;
 }
Пример #2
0
 public GameLogic(GameLogic g)
 {
     //does a deep copy of GameLogic
     this.forceJumps = g.forceJumps;
     this.board = g.getBoardCopy();
     this.moveNumber = g.moveNumber;
     this.blackPieces = g.blackPieces;
     this.redPieces = g.redPieces;
     if (multiJumpLoc != null) {
         this.multiJumpLoc = new Vector(g.multiJumpLoc);
     } else {
         this.multiJumpLoc = null;
     }
     this.turnNumber = g.turnNumber;
 }
Пример #3
0
 public GameLogic(int boardHeight, int boardWidth, bool forceJumps)
 {
     this.forceJumps = forceJumps;
     this.board = new Board(boardWidth, boardHeight);
     moveNumber = 0;
     turnNumber = 0;
     movesMade = new List<Move>();
     successMoves = new List<MoveAttempt>();
 }