public IResourceFactory Create(IResourceFactoryConfiguration resourceFactoryStartingConfiguration, ILocation location) { IProduction <ITradeItem> test = new Production(new Power(), 5.0, new List <IProductionRequires>()); IList <IProduction <ITradeItem> > productionList = new List <IProduction <ITradeItem> >(); productionList.Add(test); var resourceFactory = new ResourceFactory(productionList, null, resourceFactoryStartingConfiguration, location); return(resourceFactory); }
public ResourceFactory(IList <IProduction <ITradeItem> > production, IList <ITradableStock <ITradeItem> > tradableStock, IResourceFactoryConfiguration resourceFactoryConfiguration, ILocation location) { if (production == null) { throw new ArgumentNullException(nameof(production)); } if (tradableStock == null) { throw new ArgumentNullException(nameof(tradableStock)); } if (resourceFactoryConfiguration == null) { throw new ArgumentNullException(nameof(resourceFactoryConfiguration)); } if (location == null) { throw new ArgumentNullException(nameof(location)); } TradableStockItems = tradableStock; Production = production; Credits = resourceFactoryConfiguration.StartingCredits; Location = location; ResourceStorage = new List <IStorage>(); ResourceStorage.Add(new Storage(new Power())); ResourceStorage.Add(new Storage(new Water())); ResourceStorage.Add(new Storage(new Food())); }