public void OnMouseClick(IMouse mouse, Point location) { switch (_state) { case State.WaitLineBeginPoint: _begin = location; _state = State.WaitLineEndPoint; break; case State.WaitLineEndPoint: _end = location; _state = State.WaitLineBeginPoint; mouse.DrawPad.Add(new Line(_begin, _end)); break; } }
public Context(State state) { this.State = state; Console.WriteLine("Initial state!"); }
public Context(State state) { State = state; }