コード例 #1
0
        public GameBoard()
        {
            _pillars = new Pillar[24];

            for (int i = 0; i < 24; i++)
            {
                _pillars[i] = new Pillar();
            }

            _freedTokens = new int[2] {
                0, 0
            };
            _imprisonedTokens = new int[2] {
                0, 0
            };
        }
コード例 #2
0
        private bool MoveATokenIntoPillar(Player player, int whichPillar)
        {
            Pillar pillar      = _pillars[whichPillar - 1];
            Color  before      = pillar.Color;
            bool   movedAToken = pillar.RecieveToken(player);

            if (movedAToken == true && pillar.Color != before)
            {
                if (player.ID == 1)
                {
                    _imprisonedTokens[1]++;
                }
                else
                {
                    _imprisonedTokens[0]++;
                }
            }

            return(movedAToken);
        }