Esempio n. 1
0
 public void SetVirtualBoard(Board board)
 {
     for (int x = 0; x < board.mAllCells.GetLength(0); x++)
     {
         for (int y = 0; y < board.mAllCells.GetLength(1); y++)
         {
             if (board.mAllCells[x, y].mCurrentPiece != null)
             {
                 Piece        piece    = board.mAllCells[x, y].mCurrentPiece;
                 VirtualPiece newPiece = new VirtualPiece();
                 newPiece.SetVirtualPiece(piece.pieceName, piece.playerOwnerInt, piece.mPossibleMovement, piece.isDead, new Vector2Int(x, y), this);
                 mAllCells[x, y] = newPiece;
                 playerPiecesDict[piece.playerOwnerInt].Add(newPiece);
             }
         }
     }
     foreach (KeyValuePair <int, Cell[, ]> kvp in board.sideBoardDict)
     {
         for (int x = 0; x < kvp.Value.GetLength(0); x++)
         {
             for (int y = 0; y < kvp.Value.GetLength(1); y++)
             {
                 if (kvp.Value[x, y].mCurrentPiece != null)
                 {
                     Piece        piece    = kvp.Value[x, y].mCurrentPiece;
                     VirtualPiece newPiece = new VirtualPiece();
                     newPiece.SetVirtualPiece(piece.pieceName, piece.playerOwnerInt, piece.mPossibleMovement, piece.isDead, new Vector2Int(x, y), this);
                     sideBoardDict[kvp.Key].Add(newPiece);
                     playerPiecesDict[piece.playerOwnerInt].Add(newPiece);
                 }
             }
         }
     }
     player1Utils = EvaluateVirtualBoard();
 }
Esempio n. 2
0
    public VirtualPiece ClonePiece(VirtualBoard newVirtualBoard)
    {
        VirtualPiece newPiece = new VirtualPiece();

        newPiece.SetVirtualPiece(cPieceName, cPlayerInt, cPossibleMovement, cIsDead, cCurrentPosition, newVirtualBoard);
        return(newPiece);
    }