Enum ETradeReason
- java.lang.Object
-
- java.lang.Enum<ETradeReason>
-
- ch.sahits.game.openpatrician.engine.player.ETradeReason
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ETradeReason>
public enum ETradeReason extends java.lang.Enum<ETradeReason>
The various reasons for trading a ware.- Author:
- Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 08, 2017
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PRODUCED_WARE_IN_CITY
Ware is produced in the cityPRODUCED_WARE_IN_WORKSHOP
Ware is produced in players workshopREQUIRE_FOR_BASIC_NEEDS
Ware is required to cover basic needs in cityREQUIRE_FOR_CITY_PRODUCTION
Ware is required for production in the cityREQUIRE_FOR_PRODUCTION
Ware is required for production in players workshops
-
Constructor Summary
Constructors Modifier Constructor Description private
ETradeReason(boolean buyReason, int prio)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Comparator<ETradeReason>
comparator()
boolean
isBuyReason()
Is the reason a buy reason.static ETradeReason
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ETradeReason[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
REQUIRE_FOR_PRODUCTION
public static final ETradeReason REQUIRE_FOR_PRODUCTION
Ware is required for production in players workshops
-
REQUIRE_FOR_BASIC_NEEDS
public static final ETradeReason REQUIRE_FOR_BASIC_NEEDS
Ware is required to cover basic needs in city
-
PRODUCED_WARE_IN_WORKSHOP
public static final ETradeReason PRODUCED_WARE_IN_WORKSHOP
Ware is produced in players workshop
-
PRODUCED_WARE_IN_CITY
public static final ETradeReason PRODUCED_WARE_IN_CITY
Ware is produced in the city
-
REQUIRE_FOR_CITY_PRODUCTION
public static final ETradeReason REQUIRE_FOR_CITY_PRODUCTION
Ware is required for production in the city
-
-
Method Detail
-
values
public static ETradeReason[] 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 (ETradeReason c : ETradeReason.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ETradeReason 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
-
isBuyReason
public boolean isBuyReason()
Is the reason a buy reason.- Returns:
- true if it is a buy reason
-
comparator
public static java.util.Comparator<ETradeReason> comparator()
-
-