Ejemplo n.º 1
0
        public override void HandleMessage(IGameEvent gameEvent)
        {
            switch (gameEvent.EventName)
            {
            case "RequestChangeGameState":
                var newState = (EnumGameState)gameEvent.EventParams[0];
                ChangeState(newState);
                break;

            case "SnapCameraToEntity":
                var entity = (Entity)gameEvent.EventParams[0];
                _gameStateHelper.SetCameraCoords(
                    entity.GetComponent <PositionComponent>().ComponentXPositionOnMap,
                    entity.GetComponent <PositionComponent>().ComponentYPositionOnMap
                    );
                break;
            }
        }