Exemplo n.º 1
0
        public override void Initialize()
        {
            FindModules <AnimationModule>().ForEach(a => Animations.Add(a, new AnimationController(services.Make <AnimationModule>(a), services)));
            FindModules <CharacterAnimationModule>().ForEach(a => CharacterAnimations.Add(a, new CharacterAnimationController(services.Make <CharacterAnimationModule>(a), services)));
            FindModules <CharacterModule>().ForEach(a => Characters.Add(a, new CharacterController(services.Make <CharacterModule>(a), services)));
            FindModules <ItemModule>().ForEach(a => Items.Add(a, new ItemController(services.Make <ItemModule>(a), services)));
            FindModules <InventoryItemModule>().ForEach(a => InventoryItems.Add(a, new InventoryItemController(services.Make <InventoryItemModule>(a), services)));
            FindModules <RoomModule>().ForEach(a => Rooms.Add(a, new RoomController(services.Make <RoomModule>(a), services)));

            PreInitialize();
            Animations.Values.ForEach(a => a.PreInitialize());
            CharacterAnimations.Values.ForEach(c => c.PreInitialize());
            Characters.Values.ForEach(c => c.PreInitialize());
            Items.Values.ForEach(i => i.PreInitialize());
            InventoryItems.Values.ForEach(i => i.PreInitialize());
            Rooms.Values.ForEach(r => r.PreInitialize());

            Animations.Values.ForEach(a => a.Initialize());
            CharacterAnimations.Values.ForEach(c => c.Initialize());
            Characters.Values.ForEach(c => c.Initialize());
            Items.Values.ForEach(i => i.Initialize());
            InventoryItems.Values.ForEach(i => i.Initialize());
            Rooms.Values.ForEach(r => r.Initialize());

            base.Initialize();
        }