Example #1
0
 public Game()
 {
     Map = new Cell[31];
     MapFilling();
     PlayerFirst   = new Player(ChipsType.Cone, Map, true);
     PlayerSecond  = new Player(ChipsType.Coil, Map);
     Sticks        = new Sticks();
     CurrentPlayer = PlayerSecond;
 }
Example #2
0
        public void NoHumanMove(int figureNumber, Sticks sticks)
        {
            var stepCount     = sticks.Throw();
            var currentFigure = CurrentPlayer.OwnFigures.Find(figure => figure.SerialNumber == figureNumber);

            if (!MakeStep(stepCount, Map, currentFigure))
            {
                return;
            }
            if (sticks.ExtraMove)
            {
                NoHumanMove(currentFigure.SerialNumber, sticks);
            }
            ChangeCurrentPlayer();
        }
Example #3
0
        public void ArtificialIntelligenceMove(Sticks sticks, Cell[] map, int figureNumber)// ChooseFigure in other place
        //Пример: метод принимает номер фигуры и координаты цели
        {
            var stepCount = sticks.Throw();

            // var figureNumber = ChooseFigure();//Индексация должна начинаться с 0
            //OwnFigures[figureNumber - 1].MakeStep(stepCount, map);//Не обращаться по индексу у листа
            //if (OwnFigures)
            if (OwnFigures[figureNumber - 1].Location == 26 || OwnFigures[figureNumber - 1].Location == 27)
            {
                ArtificialIntelligenceMove(sticks, map, figureNumber);
            }
            else if (sticks.ExtraMove)
            {
                //Перевыбор номера
                //Step с этим номером
            }
        }