Exemplo n.º 1
0
    private Piece CreatePieceAt(PIECE_TYPES pieceType, Vector2 pos, bool team)
    {
        var piece = CreatePiece(pieceType);

        piece.SetPosition((int)pos.x, (int)pos.y);
        return(piece);
    }
Exemplo n.º 2
0
 private Piece CreatePiece(PIECE_TYPES pieceType)
 {
     if (pieceType == PIECE_TYPES.KING)
     {
         return(new King());
     }
     else if (pieceType == PIECE_TYPES.QUEEN)
     {
         return(new Queen());
     }
     else if (pieceType == PIECE_TYPES.ROOK)
     {
         return(new Rook());
     }
     else if (pieceType == PIECE_TYPES.BISHOP)
     {
         return(new Bishop());
     }
     else if (pieceType == PIECE_TYPES.KNIGHT)
     {
         return(new Knight());
     }
     else //if (pieceType == PIECE_TYPES.PAWN)
     {
         return(new Pawn());
     }
 }
Exemplo n.º 3
0
    public Piece CreatePieceAt(PIECE_TYPES pieceType, Vector2 pos, int team)
    {
        Piece piece = CreatePiece(pieceType);

        piece.SetPosition((int)pos.x, (int)pos.y);
        piece.SetTeam(team);
        return(piece);
    }