Example #1
0
        public void AddTower()
        {
            Tower towerToAdd = null;

            switch (newTowerType)
            {
                case "Arrow Tower":
                    {
                        towerToAdd = new ArrowTower(towerTexture,
                            bulletTexture, new Vector2(tileX, tileY));
                        break;
                    }
            }
            if (IsCellClear() == true && towerToAdd.Cost <= money)
            {
                towers.Add(towerToAdd);
                money -= towerToAdd.Cost;
                newTowerType = string.Empty;
            }
        }
Example #2
0
        public void AddTower()
        {
            Tower towerToAdd = null;

            switch (newTowerType)
            {
            case "Arrow Tower":
            {
                towerToAdd = new ArrowTower(towerTexture,
                                            bulletTexture, new Vector2(tileX, tileY));
                break;
            }
            }
            if (IsCellClear() == true && towerToAdd.Cost <= money)
            {
                towers.Add(towerToAdd);
                money       -= towerToAdd.Cost;
                newTowerType = string.Empty;
            }
        }