Пример #1
0
        public override void GetAvalableCellsForMove(IBoard board)
        {
            if (this._board == null)
            {
                this._board = board;
            }

            if (InCell == null)
            {
                return;
            }

            AvalableCellsForMove.Clear();

//          Поиск ходов по прямой
            MoveTo(1, 0);
            MoveTo(-1, 0);
            MoveTo(0, 1);
            MoveTo(0, -1);

//          Поиск ходов по диагонали
            MoveTo(1, 1);
            MoveTo(-1, -1);
            MoveTo(-1, 1);
            MoveTo(1, -1);
        }
Пример #2
0
        public override void GetAvalableCellsForMove(IBoard board)
        {
            if (this._board == null)
            {
                this._board = board;
            }

            AvalableCellsForMove.Clear();

            switch (FigureColor)
            {
            case FigureColor.WHITE:
                MoveTo(0, _isFirstStep ? 2 : 1);
                MoveTo(0, 1);
                break;

            case FigureColor.BLACK:
                MoveTo(0, _isFirstStep ? -2 : -1);
                MoveTo(0, -1);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            MoveTo(1, -1);
            MoveTo(-1, 1);
            MoveTo(1, 1);
            MoveTo(-1, -1);
        }
Пример #3
0
        public override void GetAvalableCellsForMove(IBoard board)
        {
            if (this._board == null)
            {
                this._board = board;
            }

            if (InCell == null)
            {
                return;
            }

            AvalableCellsForMove.Clear();

            MoveTo(1, 0);
            MoveTo(-1, 0);
            MoveTo(0, 1);
            MoveTo(0, -1);
        }