Example #1
0
 protected override void OnHandleDestroyed(EventArgs e)
 {
     _model.OnPaused  -= OnPaused;
     _model.OnStarted -= OnStarted;
     _model            = null;
     if (OnStateSwitched != null)
     {
         foreach (var d in OnStateSwitched.GetInvocationList())
         {
             OnStateSwitched -= (Action)d;
         }
     }
     base.OnHandleDestroyed(e);
 }
 protected void SwitchState(BaseGameState gameState)
 {
     OnStateSwitched?.Invoke(this, gameState);
 }
Example #3
0
 private void State_Button_Click(object sender, EventArgs e)
 {
     _model.SwitchState();
     OnStateSwitched?.Invoke();
 }