Beispiel #1
0
        private void World_Loaded(object sender, EventArgs e)
        {
            // dispose existing Distance buttons
            if (_items != null)
            {
                for (int i = 0; i < _items.Count; i++)
                {
                    var ctl = _items[i];
                    if (ctl != null)
                    {
                        ctl.Dispose();
                    }
                }
            }

            // Add all units
            _items = new List <DistanceControl>();
            float lastSpeed = 0;

            foreach (Unit unit in WorldUnits.Default)
            {
                if (unit.Speed != lastSpeed)
                {
                    var ctl = new DistanceControl(this, unit);
                    Controls.Add(ctl);
                    _items.Add(ctl);
                }
                lastSpeed = unit.Speed;
            }
            SetSize();

            // load default bullseye from settings

            /*if (World.Default.Settings.BullsEye != null)
             * {
             *  _villageStart = World.Default.Settings.BullsEye;
             * }*/
        }
        private void World_Loaded(object sender, EventArgs e)
        {
            // dispose existing Distance buttons
            if (_items != null)
            {
                for (int i = 0; i < _items.Count; i++)
                {
                    var ctl = _items[i];
                    if (ctl != null)
                    {
                        ctl.Dispose();
                    }
                }
            }

            // Add all units
            _items = new List<DistanceControl>();
            float lastSpeed = 0;
            foreach (Unit unit in WorldUnits.Default)
            {
                if (unit.Speed != lastSpeed)
                {
                    var ctl = new DistanceControl(this, unit);
                    Controls.Add(ctl);
                    _items.Add(ctl);
                }
                lastSpeed = unit.Speed;
            }
            SetSize();

            // load default bullseye from settings
            /*if (World.Default.Settings.BullsEye != null)
            {
                _villageStart = World.Default.Settings.BullsEye;
            }*/
        }