Ejemplo n.º 1
0
        public List <string> CheckIfCanMovePiece(string ChessmanPosition, ChessPiceType Chessman)
        {
            IBoardService     boardService = new BoardService();
            PiceFactory       piceFactory  = new PiceFactory();
            IChessMoveChecker pice         = piceFactory.CreatePice(Chessman);

            return(pice.AvailableMoves(ChessmanPosition, boardService));
        }
Ejemplo n.º 2
0
        public IChessMoveChecker CreatePice(ChessPiceType piceName)
        {
            switch (piceName)
            {
            case ChessPiceType.Knight:
                return(new Knight());

            case ChessPiceType.Rook:
                return(new Rook());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }