Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (SwitchState)
            {
                Counter += gameTime.ElapsedGameTime;

                if (Counter > StayOn)
                {
                    SwitchState = false;

                    SwitchedOff?.Invoke(this);
                    Toggled?.Invoke(this);
                }
            }
        }
Exemplo n.º 2
0
 protected virtual void OnSwitchedOff(EventArgs e)
 {
     SwitchedOff?.Invoke(this, e);
 }
Exemplo n.º 3
0
 private void On(SwitchedOff evt)
 {
     this.IsOn = false;
     _state.TransitionTo("Off");
 }