Enum EAITradeStrategyType
- java.lang.Object
-
- java.lang.Enum<EAITradeStrategyType>
-
- ch.sahits.game.openpatrician.engine.player.strategy.EAITradeStrategyType
-
- All Implemented Interfaces:
BaseStrategyType<IAITradeStrategy>
,IAITradeStrategyType
,java.io.Serializable
,java.lang.Comparable<EAITradeStrategyType>
public enum EAITradeStrategyType extends java.lang.Enum<EAITradeStrategyType> implements IAITradeStrategyType
Strategy type for the trade strategy.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CHEAP_PRODUCTION
COLLECT_WARES
COLLECT_WARES_FOR_STORAGE_LOCATION
DELIVER_WARES_FROM_CENTRAL_STORAGE
DYNAMIC_TRADE_ROUTE
PRODUCTION_CHAIN
SUPPLY_HOMETOWN
TRADE_ROUTE
-
Field Summary
Fields Modifier and Type Field Description private org.springframework.context.ApplicationContext
context
private java.util.Set<ETradeStrategyPreference>
preferance
private java.lang.Class<? extends IAITradeStrategy>
strategyClass
-
Constructor Summary
Constructors Modifier Constructor Description private
EAITradeStrategyType(java.lang.Class<? extends IAITradeStrategy> strategyClass, ETradeStrategyPreference... prefs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IAITradeStrategy
getStrategy()
Retrieve an instance of the strategy defined by the type.java.util.Set<ETradeStrategyPreference>
getStrategyPreferrance()
Get a set of preference that indicate good matches for this strategy.void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
static EAITradeStrategyType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EAITradeStrategyType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CHEAP_PRODUCTION
public static final EAITradeStrategyType CHEAP_PRODUCTION
-
TRADE_ROUTE
public static final EAITradeStrategyType TRADE_ROUTE
-
DYNAMIC_TRADE_ROUTE
public static final EAITradeStrategyType DYNAMIC_TRADE_ROUTE
-
PRODUCTION_CHAIN
public static final EAITradeStrategyType PRODUCTION_CHAIN
-
SUPPLY_HOMETOWN
public static final EAITradeStrategyType SUPPLY_HOMETOWN
-
COLLECT_WARES_FOR_STORAGE_LOCATION
public static final EAITradeStrategyType COLLECT_WARES_FOR_STORAGE_LOCATION
-
DELIVER_WARES_FROM_CENTRAL_STORAGE
public static final EAITradeStrategyType DELIVER_WARES_FROM_CENTRAL_STORAGE
-
COLLECT_WARES
public static final EAITradeStrategyType COLLECT_WARES
-
-
Field Detail
-
context
private org.springframework.context.ApplicationContext context
-
strategyClass
private final java.lang.Class<? extends IAITradeStrategy> strategyClass
-
preferance
private final java.util.Set<ETradeStrategyPreference> preferance
-
-
Constructor Detail
-
EAITradeStrategyType
private EAITradeStrategyType(java.lang.Class<? extends IAITradeStrategy> strategyClass, ETradeStrategyPreference... prefs)
-
-
Method Detail
-
values
public static EAITradeStrategyType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EAITradeStrategyType c : EAITradeStrategyType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EAITradeStrategyType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Throws:
org.springframework.beans.BeansException
-
getStrategy
public IAITradeStrategy getStrategy()
Description copied from interface:BaseStrategyType
Retrieve an instance of the strategy defined by the type.- Specified by:
getStrategy
in interfaceBaseStrategyType<IAITradeStrategy>
- Returns:
- strategy defined by this type.
-
getStrategyPreferrance
public java.util.Set<ETradeStrategyPreference> getStrategyPreferrance()
Description copied from interface:IAITradeStrategyType
Get a set of preference that indicate good matches for this strategy. The set is empty by default.- Specified by:
getStrategyPreferrance
in interfaceIAITradeStrategyType
- Returns:
- empty set.
-
-