示例#1
0
        public ItemBox(Incubators item)
        {
            InitializeComponent();
            DisableTimer    = true;
            lbl.Font        = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            pb.Image        = item.Icon(item.IsUnlimited);
            lblTime.Text    = String.Format(CultureInfo.InvariantCulture, "{0:0.0}Km", item.TotalKM);
            lblTime.Visible = true;
            lbl.Text        = item.InUse ? String.Format(CultureInfo.InvariantCulture, "{0:0.0}Km", item.KM) : "0.0Km";
            lblTime.Parent  = pb;

            if (item.InUse)
            {
                Enabled = false;
                return;
            }
            lblTime.Text = "Empty";
            lbl.Text     = item.IsUnlimited ? "(∞)" : $"{item.UsesRemaining} times";

            foreach (Control control in Controls)
            {
                control.MouseEnter += ChildMouseEnter;
                control.MouseLeave += ChildMouseLeave;
                control.MouseClick += delegate { SetIncubator_Click(item); };
                Box = control;
            }
        }
示例#2
0
        public void AddOrUpdate(PokemonData egg, Incubators incu = null)
        {
            var eggModel = new Eggs(egg)
            {
                Hatchable = incu == null
            };

            Eggs.Add(eggModel);
        }
示例#3
0
        public void AddOrUpdate(PokemonData egg, Incubators incu = null)
        {
            var eggModel = new Eggs(egg)
            {
                Hatchable = incu == null,
            };

            if (!eggModel.Hatchable && incu != null)
            {
                eggModel.KM = incu.KM;
            }
            Eggs.Add(eggModel);
        }
示例#4
0
        private void SetIncubator_Click(Incubators Incubator)
        {
            if (Box.BackColor == Color.LightGreen)
            {
                Box.BackColor = Color.Transparent; //SystemColors.Control;
                _incubator    = null;
                return;
            }

            if (Incubator.InUse)
            {
                MessageBox.Show("Incubator in use choice an other", "Incubator Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            _incubator    = Incubator;
            Box.BackColor = Color.LightGreen;
        }
示例#5
0
        public void AddOrUpdateIncubator(EggIncubator incu)
        {
            var incuModel = new Incubators(incu);

            Incubators.Add(incuModel);
        }