Exemple #1
0
 public Timer(int time, bool singleUse, Observer observer)
 {
     GlobalTime.RegisterTimeObserver(this);
     observable.RegisterObserver(observer);
     this.time      = time;
     this.startTime = time;
     this.singleUse = singleUse;
 }
Exemple #2
0
 public Timer(int time, bool singleUse, List <Observer> observers)
 {
     if (observers.Count < 1)
     {
         throw new System.Exception();
     }
     GlobalTime.RegisterTimeObserver(this);
     foreach (Observer obs in observers)
     {
         observable.RegisterObserver(obs);
     }
     this.time      = time;
     this.startTime = time;
     this.singleUse = singleUse;
 }
Exemple #3
0
 void Start()
 {
     GlobalTime.RegisterTimeObserver(this);
 }