Exemplo n.º 1
0
        protected void GameLoadContent()
        {
            //Post-initization (e.g. loading game content)
            var spriteFactory = new SpriteFactory(GraphicsManager);

            GraphicsManager.LoadContent(Content);
            MenuManager.LoadContent(
                new MenuPainter(GraphicsManager),
                new MenuFactory(GraphicsManager));
            WorldManager.LoadContent(spriteFactory,
                new WorldPainter(GraphicsManager));
            ScreenManager.LoadContent(GraphicsManager.Camera);

            //Registering listeners of ControlManager
            foreach (var manager in Managers)
                manager.RegisterControls(ControlsManager);

            //And providing an ability to ask Game Class to do something
            foreach (var manager in Managers)
                manager.Register(this);
        }
Exemplo n.º 2
0
 public EntityFactory(SpriteFactory spriteFactory, WorldManager worldManager)
 {
     //Sprite factory is using for creating entities' own sprites
     _spriteFactory = spriteFactory;
     _worldProxy = new WorldProxy(worldManager);
 }
Exemplo n.º 3
0
 public void LoadContent(SpriteFactory spriteFactory, WorldPainter painter)
 {
     _factory = new EntityFactory(spriteFactory, this);
     _worldPainter = painter;
 }