Example #1
0
        private void PopulateState(BaseItem item)
        {
            if (item is Empty empty)
            {
                EmptyItems.Add(empty);
                return;
            }

            if (item is AiTank aiTank)
            {
                AiTanks.Add(aiTank);

                if (item is AiPrizeTank aiPrizeTank)
                {
                    AiPrizeTanks.Add(aiPrizeTank);
                }

                return;
            }

            if (item is EnemyTank enemyTank)
            {
                EnemyTanks.Add(enemyTank);
                return;
            }

            if (item is MyTank myTank)
            {
                MyTank = myTank;
                return;
            }

            if (item is Bullet bullet)
            {
                Bullets.Add(bullet);
                return;
            }

            if (item is River river)
            {
                Rivers.Add(river);
                return;
            }

            if (item is Tree tree)
            {
                Trees.Add(tree);
                return;
            }

            if (item is Ice ice)
            {
                Ice.Add(ice);
                return;
            }
        }
Example #2
0
 public void AddAiPrizeTank(AiTank aiTank, AiTank prevRoundAiPrizeTank)
 {
     aiTank.SetHealth(prevRoundAiPrizeTank.Health);
     aiTank.BorderColor = prevRoundAiPrizeTank.BorderColor;
     AiPrizeTanks.Add(aiTank);
 }