예제 #1
0
 public SoundManager(MessageManager messageManager)
 {
     _cachedEffects  = new Dictionary <string, SoundEffectInstance>();
     _messageManager = messageManager;
     _messageManager.AddListener <PlaySoundEffectMessage>(OnPlaySoundEffect);
     _messageManager.AddListener <PlaySongMessage>(OnPlaySong);
 }
예제 #2
0
파일: Camera.cs 프로젝트: jolson88/Hiromi
        public Camera(MessageManager messageManager)
        {
            _scale  = 1f;
            _offset = Vector2.Zero;
            _lookAt = GraphicsService.Instance.DesignedScreenSize / 2.0f;

            RebuildBoundingBox();
            RebuildTransformationMatrix();

            _messageManager = messageManager;
            _messageManager.AddListener <ZoomCameraMessage>(OnZoomCamera);
            _messageManager.AddListener <NudgeCameraMessage>(OnMoveCamera);
            _messageManager.AddListener <RotateCameraMessage>(OnRotateCamera);
            _messageManager.AddListener <ScreenSizeChangedMessage>(OnScreenSizeChanged);
        }
예제 #3
0
        public GameObjectManager(ProcessManager processManager, MessageManager messageManager)
        {
            _processManager = processManager;
            _messageManager = messageManager;
            _objects        = new List <GameObject>();

            _messageManager.AddListener <AddGameObjectRequestMessage>(OnNewGameObject);
        }
예제 #4
0
        public SceneGraph(MessageManager messageManager)
        {
            this.DebugVisuals = false;
            this._spriteBatch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice);
            this._nonTransformedSpriteBatch = new SpriteBatch(GraphicsService.Instance.GraphicsDevice);

            _messageManager   = messageManager;
            _gameObjectLookup = new Dictionary <int, List <IRenderAwareComponent> >();

            _renderComponents = new Dictionary <RenderPass, List <IRenderAwareComponent> >();
#if WINDOWS_PHONE
            foreach (var val in EnumHelper.GetValues <RenderPass>())
#else
            foreach (var val in Enum.GetValues(typeof(RenderPass)))
#endif
            {
                _renderComponents.Add((RenderPass)val, new List <IRenderAwareComponent>());
            }

            _messageManager.AddListener <GameObjectLoadedMessage>(OnGameObjectLoaded);
            _messageManager.AddListener <GameObjectRemovedMessage>(OnGameObjectRemoved);

            _camera = new Camera(_messageManager);
        }