public TdglComponentManager(Game game, UiComponentManager uiManager)
            : base(game)
        {
            //Game.Components.Add(this);

            _xnaComponents = new List <GameComponent>();
            _components    = new MutableDistinctSet <TdglComponent>();

            _componentsSortedByDrawOrder = new List <TdglComponent>();
            _componentDrawOrders         = new Dictionary <TdglComponent, int>();

            DrawOrder = GameEnvironment.GamePlayManagerDrawOrder;

            UiManager           = AddComponent(uiManager);
            UiManager.DrawOrder = 1;
        }
Пример #2
0
        //TODO: all list.Contains() run in O(n), so switch to a dictionary/hashtable or something to get O(1)
        public MobManager(WorldManager worldManager)
        {
            WorldManager = worldManager;

            _mobs            = new MutableDistinctSet <Mob>();
            MobBodies        = new Dictionary <PhysicalBody, Mob>();
            MobFixtures      = new Dictionary <Fixture, Mob>();
            MobBucketManager = new MobBucketManager(80, WorldManager);

            //MobSpriteBatches = new Dictionary<int, SpriteBatch>();
            //for (int z = GameEnvironment.WorldLayerMinimum; z < GameEnvironment.WorldLayerMaximum; z++)
            //{
            //    MobSpriteBatches[z] = new SpriteBatch(GameEnvironment.Game.GraphicsDevice);
            //}

            MobSpriteBatch = new SpriteBatch(GameEnvironment.Game.GraphicsDevice);
        }