private void Lever_OnCollision(Box sender, CollisionEventArgs e) { if (e.CollidedWith is Character) { SwitchState = true; Counter = TimeSpan.Zero; SwitchedOn?.Invoke(this); Toggled?.Invoke(this); } }
protected virtual void OnSwitchedOn(EventArgs e) { SwitchedOn?.Invoke(this, e); }
private void On(SwitchedOn evt) { this.IsOn = true; _state.TransitionTo("On"); }