Class AIPlayerContext
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.player.AIPlayerContext
-
public class AIPlayerContext extends java.lang.ObjectContext holding data for various trade strategies for an AIPlayer.- Author:
- Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 05, 2017
-
-
Constructor Summary
Constructors Constructor Description AIPlayerContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ICity city, ITradeStategyHint hint)Add a new hint to a city.voidadd(BaseStrategyType<?> strategyType)Add a new strategy type.voidaddWeightedTradeStrategy(IAITradeStrategyType strategyType)Add a new trade strategy to the weighted map.java.util.List<BaseStrategyType<?>>getGeneralStrategyTypes()java.util.List<ITradeStategyHint>getHints(ICity city)Retrieve all hints for the city.java.util.Map<IAITradeStrategyType,java.lang.Integer>getWeightedStrategies()Retrieve the weighted trade strategies.
-
-
-
Method Detail
-
add
public void add(ICity city, ITradeStategyHint hint)
Add a new hint to a city.- Parameters:
city- for which to add the hinthint- to be added
-
getHints
public java.util.List<ITradeStategyHint> getHints(ICity city)
Retrieve all hints for the city.- Parameters:
city- for which to retrieve the hints- Returns:
- list of city hints.
-
getGeneralStrategyTypes
public java.util.List<BaseStrategyType<?>> getGeneralStrategyTypes()
-
add
public void add(BaseStrategyType<?> strategyType)
Add a new strategy type.- Parameters:
strategyType- type of the strategy to be added
-
addWeightedTradeStrategy
public void addWeightedTradeStrategy(IAITradeStrategyType strategyType)
Add a new trade strategy to the weighted map. strategies can be added multiple times, which adds up the weight.- Parameters:
strategyType- to be added.
-
getWeightedStrategies
public java.util.Map<IAITradeStrategyType,java.lang.Integer> getWeightedStrategies()
Retrieve the weighted trade strategies.- Returns:
- map of the weighted trade strategies.
-
-