private void listViewBabies_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listViewBabies.SelectedIndices.Count > 0)
     {
         if (listViewBabies.SelectedItems[0].Tag.GetType() == typeof(Creature))
         {
             Creature c  = (Creature)listViewBabies.SelectedItems[0].Tag;
             int      sI = Values.V.speciesNames.IndexOf(c.species);
             setSpeciesIndex?.Invoke(sI);
             if (sI >= 0 && Values.V.species[sI].breeding != null && c.growingUntil > DateTime.Now)
             {
                 double maturing = Math.Round(1 - c.growingUntil.Subtract(DateTime.Now).TotalSeconds / Values.V.species[sI].breeding.maturationTimeAdjusted, 2);
                 if (maturing > 0 && maturing <= 1)
                 {
                     nudCurrentWeight.Value = (decimal)(maturing * c.valuesBreeding[4]);
                     nudTotalWeight.Value   = (decimal)c.valuesBreeding[4];
                 }
             }
         }
         else if (listViewBabies.SelectedItems[0].Tag.GetType() == typeof(IncubationTimerEntry))
         {
             IncubationTimerEntry ite = (IncubationTimerEntry)listViewBabies.SelectedItems[0].Tag;
             int sI = Values.V.speciesNames.IndexOf(ite.mother.species);
             setSpeciesIndex?.Invoke(sI);
         }
     }
 }
 private void deleteTimerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listViewBabies.SelectedIndices.Count > 0 &&
         listViewBabies.SelectedItems[0].Tag.GetType() == typeof(IncubationTimerEntry))
     {
         IncubationTimerEntry ite = (IncubationTimerEntry)listViewBabies.SelectedItems[0].Tag;
         if (MessageBox.Show("Delete this timer?\n" + ite.mother.species + ", ending in " + Utils.timeLeft(ite.incubationEnd), "Delete?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             removeIncubationTimer(ite);
             recreateList();
             onChange?.Invoke();
         }
     }
 }
 public void deleteAllExpiredIncubationTimers()
 {
     if (MessageBox.Show("Delete all expired incubation timers?", "Delete?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         foreach (ListViewItem lvi in listViewBabies.Items)
         {
             if ((lvi.Tag.GetType() == typeof(IncubationTimerEntry)))
             {
                 IncubationTimerEntry ite = (IncubationTimerEntry)lvi.Tag;
                 if (ite.incubationStarted && ite.incubationEnd < DateTime.Now)
                 {
                     removeIncubationTimer(ite);
                 }
             }
         }
         recreateList();
         onChange?.Invoke();
     }
 }
 private void removeIncubationTimer(IncubationTimerEntry ite)
 {
     cc.incubationListEntries.Remove(ite);
 }