public Timer(int time, bool singleUse, Observer observer) { GlobalTime.RegisterTimeObserver(this); observable.RegisterObserver(observer); this.time = time; this.startTime = time; this.singleUse = singleUse; }
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; }
void Start() { GlobalTime.RegisterTimeObserver(this); }