/// <summary> /// constractor /// </summary> /// <param name="name"> effect name </param> /// <param name="value"> effect value </param> /// <param name="tools"> tool with this effect</param> public ItemsEffect(string name, float value, Items tool) { m_name = name; m_type = EffectTypeHolder.GetType(name); m_value = value; m_toolLink = tool; m_maxHits = (uint)(1 / m_toolLink.m_bug); m_hits = (int)m_maxHits; m_criticalHits = (int)m_toolLink.m_critical; m_toolName = tool.m_name; }
/// <summary> /// loading data from xml files /// </summary> public void Loading() { //order is important! from parents to children, science the last one EffectTypeHolder.Load("effect_map"); MineralResource.Load("mineralResource_Map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Resource.Load("resource_Map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); GameMaterial.Load("materials_Map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Items.Load("items_Map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Buildings.Load("buildings_Map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Army.Load("army_map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Process.Load("process_map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); Science.Load("science_map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); DomesticAnimal.Load("domesticAnimal_map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); WildAnimal.Load("wildAnimal_map"); //Debug.Log("all items amount:" + GameAbstractItem.ItemsCount()); LearningTip.Load("AllTips_Map"); GameAbstractItem.ParseDependency(); Population ppl = new Population { m_people = GetComponent <People>(), m_isItOpen = 1 }; AbstractObject.m_sEverything.Add(ppl); Localization.GetLocalization().FirstLoad(); Localization.GetLocalization().ChangeLanguage(Localization.GetLocalization().m_currentLanguage); AbstractObject.ClearUnparsed(); Debug.Log("loading finished"); }