示例#1
0
        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;
        }
示例#2
0
        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);
        }
示例#3
0
        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);
            }
        }
示例#4
0
 public void ApplySettings(HiveSettings hiveSettings)
 {
     this.hiveSettings = hiveSettings;
 }