Пример #1
0
 public static KingMoves Get()
 {
     if (instance == null)
     {
         instance = new KingMoves();
     }
     return(instance);
 }
Пример #2
0
        private static Moves Create(PieceEnum piece)
        {
            switch (piece)
            {
            case PieceEnum.Knight:
                return(KnightMoves.Get());

            case PieceEnum.Bishop:
                return(BishopMoves.Get());

            case PieceEnum.Rook:
                return(RookMoves.Get());

            case PieceEnum.Queen:
                return(QueenMoves.Get());

            case PieceEnum.King:
                return(KingMoves.Get());

            case PieceEnum.Pawn:
                return(PawnMoves.Get());
            }
            return(null);
        }