private void DoYourJob() { TowerData.BuildingType type = Data.Type; if (type == TowerData.BuildingType.Generator) { Grow(); } else if (type == TowerData.BuildingType.Firewall) { Aim(); } }
public void LevelUP() { if (isOperational) { int currentLevel = Data.Level; float cost = UpgradeCost[currentLevel]; if (currentLevel < 2 && Data.Population >= cost) { Data.AddUnits(-cost); isOperational = false; newLevel = currentLevel + 1; newType = Data.Type; Particles.PlayTinker(); } } }
public void ChangeType(TowerData.BuildingType newType) { if (isOperational) { TowerData.BuildingType currentType = Data.Type; if (newType != currentType && Data.Population >= ConvertionCost) { if (currentType == TowerData.BuildingType.Lab) { Data.ControllerData.LooseLab(); } Data.AddUnits(-ConvertionCost); isOperational = false; newLevel = 0; this.newType = newType; Particles.PlayTinker(); } } }
public void ChangeType(TowerData.BuildingType newType) { TBehavior.ChangeType(newType); }