Exemplo n.º 1
0
 public void ProcessEvent(GameEventType eventType, GameEvent <object> gameEvent)
 {
     if (eventType == GameEventType.GameStateEvent)
     {
         switch (gameEvent.Message)
         {
         case "CHANGE_STATE":
             var state = StateTransformer.TransformStringToState(gameEvent.Parameter1);
             SwitchState(state);
             break;
         }
     }
     else if (eventType == GameEventType.InputEvent)
     {
         ActiveState.HandleKeyEvent(gameEvent.Message, gameEvent.Parameter1);
     }
 }
Exemplo n.º 2
0
        public void ProcessEvent(GameEventType eventType, GameEvent <object> gameEvent)
        {
            if (eventType == GameEventType.InputEvent)
            {
                switch (gameEvent.Parameter1)
                {
                case "KEY_PRESS":
                    ActiveState.HandleKeyEvent(gameEvent.Message, gameEvent.Parameter1);
                    break;

                case "KEY_RELEASE":
                    break;
                }
            }
            else if (eventType == GameEventType.GameStateEvent)
            {
                switch (gameEvent.Message)
                {
                case "CHANGE_STATE":
                    SwitchState(StateTransformer.TransformStringToState(gameEvent.Parameter1));
                    break;
                }
            }
        }