private void OnTick() { lastTickEvent.Canceled = true; lastTickEvent = new TickEventArgs(TimeLimit - ElapsedTime); Tick(this, lastTickEvent); }
public GameTimer(int timeLimit) { this.TimeLimit = timeLimit; this.secondTimer = new Timer(OnTick); this.lastTickEvent = new TickEventArgs(0); }