Enum Class Element
- All Implemented Interfaces:
Serializable, Comparable<Element>, Constable
楓之谷中的元素屬性列舉,用於描述技能與怪物的元素類型。
定義八種元素:NEUTRAL(無屬性)、PHYSICAL(物理)、
FIRE(火)、ICE(冰)、LIGHTING(雷)、
POISON(毒)、HOLY(聖)、DARKNESS(暗)。
其中火、冰、聖標記為 special = true。
提供兩個工廠方法:
getFromChar(char)— 從 WZelemAttr字串的單字元解析 (F/I/L/S/H/P/D),供MapleLifeFactory.decodeElementalString(MapleMonsterStats, String)使用。getFromId(int)— 依整數 ID 反查,供封包層使用。
ElementalEffectiveness 搭配 MapleMonsterStats.getEffectiveness(Element) 查詢。-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementgetFromChar(char c) static ElementgetFromId(int c) intgetValue()booleanstatic ElementReturns the enum constant of this class with the specified name.static Element[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NEUTRAL
-
PHYSICAL
-
FIRE
-
ICE
-
LIGHTING
-
POISON
-
HOLY
-
DARKNESS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isSpecial
public boolean isSpecial() -
getFromChar
-
getFromId
-
getValue
public int getValue()
-