示例#1
0
		public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
			IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog, IAudioFactory sound)
		{
			Graphics = graphics;
			Inventory = inventory;
			UI = ui;
			Room = room;
			Outfit = outfit;
			Object = obj;
			Dialog = dialog;
			Sound = sound;
		}
示例#2
0
 public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                       IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                       IAudioFactory sound, IFontLoader fontFactory)
 {
     Graphics  = graphics;
     Inventory = inventory;
     UI        = ui;
     Room      = room;
     Outfit    = outfit;
     Object    = obj;
     Dialog    = dialog;
     Sound     = sound;
     Fonts     = fontFactory;
 }
示例#3
0
        public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                              IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                              IAudioFactory sound, IFontLoader fontFactory, IResourceLoader resources, IShaderFactory shaders,
                              Resolver resolver)
        {
            Graphics  = graphics;
            Inventory = inventory;
            UI        = ui;
            Room      = room;
            Outfit    = outfit;
            Object    = obj;
            Dialog    = dialog;
            Sound     = sound;
            Fonts     = fontFactory;
            Resources = resources;
            TypedParameter gameFactoryParam = new TypedParameter(typeof(IGameFactory), this);

            Masks   = resolver.Container.Resolve <IMaskLoader>(gameFactoryParam);
            Shaders = shaders;
        }
示例#4
0
        protected void SetupServiceProvider(params ItemMeta[] itemMetas)
        {
            this.SetupDependencies();

            foreach (var itemMeta in itemMetas)
            {
                this.ItemRegistry.AddItemMeta(itemMeta);
            }

            this.ServiceCollection.AddItemTypes(this.ItemRegistry);
            this.ServiceProvider = this.ServiceCollection.BuildServiceProvider();

            this.ItemFactory  = this.ServiceProvider.GetRequiredService <IItemFactory>();
            this.ItemServices = this.ServiceProvider.GetRequiredService <AggregatedItemServices>();

            this.InventoryFactory  = this.ServiceProvider.GetRequiredService <IInventoryFactory>();
            this.InventoryServices = this.ServiceProvider.GetRequiredService <AggregatedInventoryServices>();

            this.ItemSplitStrategyHandler = this.ServiceProvider.GetRequiredService <IItemSplitStrategyHandler>();
            this.ItemMergeStrategyHandler = this.ServiceProvider.GetRequiredService <IItemMergeStrategyHandler>();

            this.Item      = (Item)this.ItemFactory.CreateItem(itemMetas.First(), 1);
            this.Inventory = this.InventoryFactory.CreateInventory(100);
        }
示例#5
0
 public InventoryService(IInventoryFactory inventoryFactory)
 {
     _inventoryFactory = inventoryFactory;
 }
 public InventoryBuilderService(IInventoryFactory inventoryFactory, IItemFactory itemFactory)
 {
     this.inventoryFactory = inventoryFactory;
     this.itemFactory      = itemFactory;
 }