public int GetMaxTrainCount() { Building b = (Building)GetParent(); BuildingData bd = b.GetBuildingData(); return(bd.GetUnitProduction(b.GetUpgradeLevel())); }
public void SetUnitType(GameObject go) { Building b = (Building)GetParent(); BuildingData bd = b.GetBuildingData(); m_vIsSpellForge = bd.IsSpellForge(); }
public void RemoveGameObject(GameObject go) { m_vGameObjects[go.ClassId].Remove(go); if (go.ClassId == 0) { Building b = (Building)go; BuildingData bd = b.GetBuildingData(); if (bd.IsWorkerBuilding()) { m_vLevel.WorkerManager.DecreaseWorkerCount(); } } RemoveGameObjectReferences(go); }
public void AddGameObject(GameObject go) { go.GlobalId = GenerateGameObjectGlobalId(go); if (go.ClassId == 0) { Building b = (Building)go; BuildingData bd = b.GetBuildingData(); if (bd.IsWorkerBuilding()) { m_vLevel.WorkerManager.IncreaseWorkerCount(); } } m_vGameObjects[go.ClassId].Add(go); }
public JObject Save() { JObject jsonData = new JObject(); //Buildings JArray jsonBuildingsArray = new JArray(); foreach (var go in m_vGameObjects[0]) { Building b = (Building)go; JObject jsonObject = new JObject(); jsonObject.Add("data", b.GetBuildingData().GetGlobalID()); b.Save(jsonObject); jsonBuildingsArray.Add(jsonObject); } jsonData.Add("buildings", jsonBuildingsArray); //Traps JArray jsonTrapsArray = new JArray(); foreach (var go in m_vGameObjects[4]) { Trap t = (Trap)go; JObject jsonObject = new JObject(); jsonObject.Add("data", t.GetTrapData().GetGlobalID()); t.Save(jsonObject); jsonTrapsArray.Add(jsonObject); } jsonData.Add("traps", jsonTrapsArray); //Decos JArray jsonDecosArray = new JArray(); foreach (var go in m_vGameObjects[6]) { Deco d = (Deco)go; JObject jsonObject = new JObject(); jsonObject.Add("data", d.GetDecoData().GetGlobalID()); d.Save(jsonObject); jsonDecosArray.Add(jsonObject); } jsonData.Add("decos", jsonDecosArray); return(jsonData); }
public int GetMaxTrainCount() { Building parent = (Building)GetParent(); return(parent.GetBuildingData().GetUnitProduction(parent.GetUpgradeLevel())); }