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); }