コード例 #1
0
        public void HandleEvent(Event e)
        {
            switch (state)
            {
            case State.LOCKED:
                switch (e)
                {
                case Event.COIN:
                    state = State.UNLOCKED;
                    turnstileController.Unlock();
                    break;

                case Event.PASS:
                    turnstileController.Alarm();
                    break;
                }
                break;

            case State.UNLOCKED:
                switch (e)
                {
                case Event.COIN:
                    turnstileController.Thankyou();
                    break;

                case Event.PASS:
                    state = State.LOCKED;
                    turnstileController.Lock();
                    break;
                }
                break;
            }
        }
コード例 #2
0
 internal void Lock()
 {
     turnstileController.Lock();
 }
コード例 #3
0
 public override void Lock()
 {
     controller.Lock();
 }