Пример #1
0
 public void ProcessEvent(GameEventType eventType, GameEvent <object> gameEvent)
 {
     if (eventType == GameEventType.GameStateEvent && gameEvent.Message == "CHANGE_STATE")
     {
         SwitchState(StateTransformer.TransformStringToState(gameEvent.Parameter1));
     }
 }
Пример #2
0
        public void ProcessEvent(GameEventType eventType, GameEvent <object> gameEvent)
        {
            switch (gameEvent.Message)
            {
            case "CHANGE_STATE":
                SwitchState(StateTransformer.TransformStringToState(gameEvent.Parameter1));
                break;

            default:
                switch (gameEvent.Parameter1)
                {
                case "KEY_PRESS":
                    ActiveState.HandleKeyEvent(gameEvent.Message, gameEvent.Parameter1);
                    break;
                }
                break;
            }
        }