public CivilianPopulationGrowthSimulator() { this.rng = new System.Random(); this.idx = 0; CivPopKerbalBuilder builder = new CivPopKerbalBuilder(GetName); growth = new CivPopServiceGrowth(builder); death = new CivPopServiceDeath(); repo = new CivPopRepository(); CivPopVessel vessel = new CivPopVessel("vessel"); vessel.SetAllowBreeding(true); vessel.SetCapacity(1000000); repo.Add(vessel); CivPopKerbal male = new CivPopKerbal(GetName(CivPopKerbalGender.MALE), CivPopKerbalGender.MALE, 0, true); male.SetVesselId("vessel"); repo.Add(male); CivPopKerbal female = new CivPopKerbal(GetName(CivPopKerbalGender.FEMALE), CivPopKerbalGender.FEMALE, 0, true); female.SetVesselId("vessel"); repo.Add(female); }
public void Start() { if (builder == null) { builder = new CivPopKerbalBuilder(this.GenerateKerbalName); } if (contractors == null) { contractors = new CivPopServiceContractors(builder); } if (death == null) { death = new CivPopServiceDeath(); } if (growth == null) { growth = new CivPopServiceGrowth(builder); } if (rent == null) { rent = new CivPopServiceRent(); } if (gui == null) { gui = new CivilianPopulationGUI(rent); } this.rng = new System.Random(); this.service = new CivilianPopulationService(); this.monitor = new CivilianPopulationMonitor(); }
public void Start() { Instance = this; if (builder == null) { builder = new CivPopKerbalBuilder(this.GenerateKerbalName); } if (contractors == null) { contractors = new CivPopServiceContractors(builder); } if (death == null) { death = new CivPopServiceDeath(); } if (growth == null) { growth = new CivPopServiceGrowth(builder); } if (rent == null) { rent = new CivPopServiceRent(); } if (gui == null) { gui = new CivilianPopulationGUI(rent); } else { gui.InitButton(); } this.rng = new System.Random(); this.service = new CivilianPopulationService(); #if DEBUG this.monitor = new CivilianPopulationMonitor(); #endif DontDestroyOnLoad(this); StartCoroutine(SlowUpdate()); }