Ejemplo n.º 1
0
        public void MakeSelectField(pos selectField, Player playeronTurn, Manager manager) //vybrání pole
        {
            int nowX = selectField.x - 1;
            int nowY = selectField.y - 1;
            int beforeX;
            int beforeY;

            if (ContainStonePlayer(fields[nowX, nowY], playeronTurn))
            {
                beforeX = selectField.x - 1;
                beforeY = selectField.y - 1;
                Stone stone = new Stone();
                stone.properties = fields[nowX, nowY];
                stone.position   = selectField;

                if ((fields[beforeX, beforeY] & Field.choice) == Field.choice)
                {
                    fields[beforeX, beforeY] &= ~Field.choice;
                }
                fields[nowX, nowY] = fields[nowX, nowY] | Field.choice;
                SetSelectField(nowX + 1, nowY + 1);
                control.UnmarkPossibleFields(this);

                List <pos> possiblePosition = new List <pos>();
                possiblePosition = control.PossiblePosition(stone, stone.position, this);
                control.MarkPossibleField(this, possiblePosition);
            }
        }
Ejemplo n.º 2
0
        public void ChooseStone(pos SelectField, Stone selectStone) //kliknutí na určité pole
        {
            board.MakeSelectField(SelectField, PlayerOnTurn, this); //označení vybraného pole
            Board.Stone = selectStone;                              //vybrání kamene dle označeného pole
            List <pos> possiblePosition = new List <pos>();

            possiblePosition = Controlor.PossiblePosition(selectStone, selectStone.position, Board); //zapsání všech možných pozic
            Controlor.MarkPossibleField(Board, possiblePosition);                                    //označení všech možných pozic
        }