Пример #1
0
        private void setKing(string i_SlotKey)
        {
            BoardSlot   slot = m_Board[i_SlotKey];
            CheckersMen king = new CheckersMen(CheckersMen.eSign.K);

            if (slot.Content.Value.Sign == CheckersMen.eSign.O)
            {
                king = new CheckersMen(CheckersMen.eSign.U);
            }

            m_PlayerTurn.AmountOfMenOnBoard += king.Value - slot.Content.Value.Value;
            m_Board[i_SlotKey].Content       = king;
            onKingSet(new SlotContentEventArgs(i_SlotKey, king));
        }
Пример #2
0
        private void addBoardSlot(CheckersMen.eSign?i_Content, string i_Key)
        {
            BoardSlot boardSlot;

            if (i_Content == null)
            {
                boardSlot = new BoardSlot(null, i_Key[0], i_Key[1]);
            }
            else
            {
                boardSlot = new BoardSlot(i_Content, i_Key[0], i_Key[1]);
            }

            r_Board.Add(i_Key, boardSlot);
        }
Пример #3
0
        private List <PlayerMove> getPossibleSlotMoves(BoardSlot i_Slot, Direction i_Direction)
        {
            List <PlayerMove> possibleSlotMoves = new List <PlayerMove>();

            CheckersMen.eType slotMenType = i_Slot.Content.Value.Type;

            setPlayerMoveByDirection(i_Slot.Key, i_Direction.Forward, i_Direction.Left, ref possibleSlotMoves);
            setPlayerMoveByDirection(i_Slot.Key, i_Direction.Forward, i_Direction.Right, ref possibleSlotMoves);
            if (slotMenType == CheckersMen.eType.King)
            {
                setPlayerMoveByDirection(i_Slot.Key, i_Direction.Backward, i_Direction.Left, ref possibleSlotMoves);
                setPlayerMoveByDirection(i_Slot.Key, i_Direction.Backward, i_Direction.Right, ref possibleSlotMoves);
            }

            return(possibleSlotMoves);
        }