public Action(string a, GameObject str) { Do = a; if (str.GetComponent<StorageBuilding>() != null) data = new StorageBuildingSave(str); else if (str.GetComponent<Stable>() != null) data = new StableSave(str); else if (str.GetComponent<Crop>() != null) data = new CropSave(str); else if (str.GetComponent<Generator>() != null) data = new GeneratorSave(str); else if (str.GetComponent<WTP>() != null) data = new WTPSave(str); else if (str.GetComponent<Canal>() != null) data = new CanalSave(str); else if (str.GetComponent<House>() != null) data = new HouseSave(str.gameObject); else if (str.GetComponent<Farmhouse>() != null) data = new FarmhouseSave(str); else if (str.GetComponent<Workplace>() != null) data = new WorkplaceSave(str.gameObject); else if (str.GetComponent<Structure>() != null) data = new StructureSave(str.gameObject); }
public virtual void Load(StructureSave structureSave) { Location = structureSave.location; ActiveTicks = structureSave.activeTicks; alliance = Owner.alliance; extraData = structureSave.extraData; }
public Action(string a, GameObject str) { Do = a; if (str.GetComponent <StorageBuilding>() != null) { data = (new StorageBuildingSave(str)); } else if (str.GetComponent <Stable>() != null) { data = (new StableSave(str)); } else if (str.GetComponent <Factory>() != null) { data = (new FactorySave(str)); } else if (str.GetComponent <Generator>() != null) { data = (new GeneratorSave(str)); } else if (str.GetComponent <Market>() != null) { data = (new MarketSave(str.gameObject)); } else if (str.GetComponent <House>() != null) { data = (new HouseSave(str.gameObject)); } else if (str.GetComponent <Workplace>() != null) { data = (new WorkplaceSave(str.gameObject)); } else if (str.GetComponent <Structure>() != null) { data = (new StructureSave(str.gameObject)); } }
public override void Load(ObjSave o) { base.Load(o); StructureSave s = (StructureSave)o; Sizex = s.sizex; Sizey = s.sizey; Days = s.days; Weeks = s.weeks; FireCount = s.fireCount; CollapseCount = s.collapseCount; BurnCount = s.burnCount; ActiveRandomWalker = s.activeRandomWalker; ActiveCarryerWalker = s.activeCarryerWalker; ActiveImmigrant = s.activeImmigrant; OnFire = s.OnFire; world.Map.RenameArea(name, X, Y, Sizex, Sizey); }
public override void Load(ObjSave o) { base.Load(o); StructureSave s = (StructureSave)o; Sizex = s.sizex; Sizey = s.sizey; Days = s.days; Weeks = s.weeks; Months = s.months; FireRisk = s.FireRisk; CollapseRisk = s.CollapseRisk; AmountStored = s.AmountStored; ActiveRandomWalker = s.activeRandomWalker; ActiveSmartWalker = s.activeSmartWalker; world.Map.RenameArea(name, X, Y, Sizex, Sizey); collapseRiskMax = (int)(collapseRiskMax * Difficulty.GetModifier()); fireRiskMax = (int)(fireRiskMax * Difficulty.GetModifier()); }
public override void Load(StructureSave structureSave) { base.Load(structureSave); Radius = ((RadarData)extraData).radius; }