public void ParseDependency(ExcelLoading.AbstractObject rep) { try { ExcelLoading.WildAnimalItem aniRep = rep as ExcelLoading.WildAnimalItem; if (aniRep.tamed_to.Length > 0 && aniRep.tamed_to[0] != '-') { m_tamedTo = DomesticAnimal.GetAnimal(aniRep.tamed_to); } }catch (Exception e) { Debug.LogException(e); } }
/// <summary> /// parsing excel data into current format /// </summary> /// <param name="mat">target</param> /// <param name="rep">source</param> /// <returns> parsed item </returns> /// <returns></returns> public static new AbstractObject Parse(AbstractObject mat, ExcelLoading.AbstractObject rep) { DomesticAnimal ani = mat as DomesticAnimal; ExcelLoading.DomesticAnimalItem aniRep = rep as ExcelLoading.DomesticAnimalItem; if (ani != null && aniRep != null) { ani.m_container = aniRep.storageType.ParseCont(); ani.m_producePerPerson = aniRep.produce_per_person; ani.m_foodType = GameAbstractItem.ParseDependencyCounts(aniRep.foodType); ani.m_additionalProduction = GameAbstractItem.ParseDependencyCounts(aniRep.additionalProducts); //link to domesticAnimal!!! _sAllDomesticAnimal.Add(ani); } else { Debug.Log("WildAnimal.Parse: critical parse error"); } return(AbstractAnimal.Parse(mat, rep)); }
/// <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"); }
public void SetAnimal(string type, string name) { this.animal = new DomesticAnimal(type, name); }