private bool m_vIsSpellForge;//a1 + 24 public UnitProductionComponent(GameObject go) : base(go) { m_vUnits = new List<DataSlot>(); SetUnitType(go); m_vTimer = null; m_vIsWaitingForSpace = false; }
public void DeallocateWorker(GameObject go) { if (m_vGameObjectReferences.IndexOf(go) != -1) { m_vGameObjectReferences.Remove(go); } }
public void AllocateWorker(GameObject go) { if(m_vGameObjectReferences.IndexOf(go) == -1) { m_vGameObjectReferences.Add(go); } }
public bool TestGameObject(GameObject go) { bool result = true; if (m_vIgnoredObjects != null) { result = (m_vIgnoredObjects.IndexOf(go.GlobalId) == -1); } return result; }
public new bool TestGameObject(GameObject go) { bool result = false; Component c = go.GetComponent(Type, true); if(c != null) { result = base.TestGameObject(go); } return result; }
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 ResourceStorageComponent(GameObject go) : base (go) { m_vCurrentResources = new List<int>(); m_vMaxResources = new List<int>(); m_vStolenResources = new List<int>(); var table = ObjectManager.DataTables.GetTable(2); int resourceCount = table.GetItemCount(); for(int i=0;i<resourceCount;i++) { m_vCurrentResources.Add(0); m_vMaxResources.Add(0); m_vStolenResources.Add(0); } }
public bool IsSpellForge;//a1 + 20 public UnitStorageComponent(GameObject go, int capacity) : base(go) { m_vUnits = new List<UnitSlot>(); m_vMaxCapacity = capacity; SetStorageType(go); }
private CombatItemData m_vCurrentlyUpgradedUnit;//a1 + 16 //a1 + 20 -- Listener? public UnitUpgradeComponent(GameObject go) : base(go) { m_vTimer = null; m_vCurrentlyUpgradedUnit = null; }
public void RemoveGameObjectReferences(GameObject go) { foreach (var components in m_vComponents) { var markedForRemoval = new List<Component>();//can't remove in foreach so create a temp structure to store components to remove foreach(var component in components) { if (component.GetParent() == go) markedForRemoval.Add(component); } foreach (var component in markedForRemoval) components.Remove(component); } }
public void RemoveGameObjectReferences(GameObject go) { }
private int m_vUpgradeLevelInProgress;//a1 + 20 //a1 + 24 //a1 + 28 public HeroBaseComponent(GameObject go, HeroData hd) : base(go) { m_vHeroData = hd; }
public void AddIgnoreObject(GameObject go) { if (m_vIgnoredObjects == null) m_vIgnoredObjects = new List<int>(); m_vIgnoredObjects.Add(go.GlobalId); }
private int GenerateGameObjectGlobalId(GameObject go) { int index = m_vGameObjectsIndex[go.ClassId]; m_vGameObjectsIndex[go.ClassId]++; return GlobalID.CreateGlobalID(go.ClassId + 500, index); }
public void RemoveGameObjectReferences(GameObject go) { m_vComponentManager.RemoveGameObjectReferences(go); }
public void SetUnitType(GameObject go) { Building b = (Building)GetParent(); BuildingData bd = b.GetBuildingData(); m_vIsSpellForge = bd.IsSpellForge(); }
public Component(GameObject go) { m_vIsEnabled = true; m_vParentGameObject = go; }