public Settings(int frameInterval = 50, WorldSettings worldSettings = null, HiveSettings hiveSettings = null) { FrameInterval = frameInterval; if (worldSettings == null) { worldSettings = new WorldSettings(); } WorldSettings = worldSettings; if (hiveSettings == null) { hiveSettings = new HiveSettings(); } HiveSettings = hiveSettings; }
private Settings CurrentSettings() { HiveSettings hiveSettings = new HiveSettings(); hiveSettings.InitialBees = tbvHiveInitialBees.CurValue; hiveSettings.InitialHoney = tbvHiveInitialHoney.CurValue; hiveSettings.MaximumBees = tbvHiveMaximumBees.CurValue; hiveSettings.MaximumHoney = tbvHiveMaximumHoney.CurValue; hiveSettings.MinimumHoneyForCreationBees = tbvHiveMinimumHoneyForCreationBees.CurValue; hiveSettings.NectarHoneyRatio = (double)tbvHiveNectarHoneyRatio.CurValue / 100; WorldSettings worldSettings = new WorldSettings(); worldSettings.NectarHarvestedPerNewFlower = tbvWorldNectarHarvestedPerNewFlower.CurValue; Settings result = new Settings(tbvGeneralFrameInterval.CurValue, worldSettings, hiveSettings); return(result); }
public Hive(World world, BeeMessage MessageSender, HiveSettings hiveSettings = null) { this.MessageSender = MessageSender; this.world = world; if (hiveSettings == null) { hiveSettings = new HiveSettings(); } this.hiveSettings = hiveSettings; Honey = hiveSettings.InitialHoney; InitializeLocations(); Random random = new Random(); for (int i = 0; i < hiveSettings.InitialBees; i++) { AddBee(random); } }
public void ApplySettings(HiveSettings hiveSettings) { this.hiveSettings = hiveSettings; }