private void SetState(FlashlightState newState) { state = newState; switch (state) { case FlashlightState.Enabled: SetFlashlightOn(true); break; case FlashlightState.Disabled: SetFlashlightOn(false); break; } }
public void SetState(FlashlightState state) { }
public void SetState(FlashlightState state) { _state.OnExit(this); _state = state; _state.OnEnter(this); }
public Flashlight(ILamp lamp) { _lamp = lamp; _state = new Statemachine.Off(); _state.OnEnter(this); }