Пример #1
0
 public Timer(Action <float> act, float hours, RefWrapper <bool> enabled = null)
 {
     action       = act;
     time         = hours;
     currenttime  = TimeCycle.Minutes;
     this.enabled = enabled;
     Simulation.Timers.Add(this);
 }
Пример #2
0
 public void upd(GameTime g)
 {
     blood    -= bloodlossrate;
     satiation = Math.Min(satiation, maxsatiation);
     satiation = Math.Max(satiation, 0);
     if (satiation <= 0 || water <= 0 || blood <= 0)
     {
         enabled = new RefWrapper <bool>(false);
     }
 }