Пример #1
0
    Piece ClonePieceAndPromote(Piece piece, Piece.Type promotion)
    {
        Piece clone = new Piece();

        clone = DeclarePiece(promotion, 0, 0);
        clone.movedColor = piece.movedColor;
        clone.playerColor = piece.playerColor;
        clone.player = piece.player;

        clone.MoveGameObject(piece.position);

        piece.CapturePiece();

        return clone;
    }
Пример #2
0
 void CapturePiece(Piece piece)
 {
     //NOTE this really should be moved into pieces.
     piece.MoveGameObject( new Vector3(-10, -10, -10)) ; //may not be needed.
     piece.gameObject.SetActive(false);
     //tiles[(int)piece.MyCoordinates().x, (int)piece.MyCoordinates().y].occupied = false;
     piece.captured = true;
     Debug.Log("A " + piece.type + "for Player " + piece.player + " Has been captured");
 }