Class ProductionChain
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.product.ProductionChain
-
@Service @Lazy @DependentInitialisation(StartNewGameBean.class) public class ProductionChain extends java.lang.Object
Model for the production chain. All values refer to one workshop with peak efficiency and efficient production.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on May 14, 2016
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Properties
properties
-
Constructor Summary
Constructors Constructor Description ProductionChain()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getProduction(IWare ware)
double
getRequiredAmount(IWare wareToBeProduced, IWare requiredWare)
Get the required amount ofrequiredWare
to producewareToBeProduced
within a week.java.util.List<IWare>
getRequiredWares(IWare wareToBeProduced)
java.util.List<IWare>
getWaresWithProductionChain()
Retrieve all wares that require other wares to be produced.(package private) void
init()
-
-
-
Method Detail
-
init
@PostConstruct void init() throws java.io.IOException
- Throws:
java.io.IOException
-
getProduction
public double getProduction(IWare ware)
-
getRequiredAmount
public double getRequiredAmount(IWare wareToBeProduced, IWare requiredWare)
Get the required amount ofrequiredWare
to producewareToBeProduced
within a week.- Parameters:
wareToBeProduced
- ware that should be producedrequiredWare
- ware that is required- Returns:
- amount of
requiredWare
to producewareToBeProduced
within a week.
-
getWaresWithProductionChain
public java.util.List<IWare> getWaresWithProductionChain()
Retrieve all wares that require other wares to be produced.- Returns:
- List of wares that are produced in a production chain.
-
-