public SoundManager(MessageManager messageManager) { _cachedEffects = new Dictionary <string, SoundEffectInstance>(); _messageManager = messageManager; _messageManager.AddListener <PlaySoundEffectMessage>(OnPlaySoundEffect); _messageManager.AddListener <PlaySongMessage>(OnPlaySong); }
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); }
public GameObjectManager(ProcessManager processManager, MessageManager messageManager) { _processManager = processManager; _messageManager = messageManager; _objects = new List <GameObject>(); _messageManager.AddListener <AddGameObjectRequestMessage>(OnNewGameObject); }
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); }