Enum Class ItemLoader
- All Implemented Interfaces:
Serializable, Comparable<ItemLoader>, Constable
道具持久化的存取策略列舉,封裝各種道具來源(角色背包、帳號倉庫、現金商城等)的資料庫表名與鍵欄位。
每個常數持有對應的道具主表(table)、裝備附加表(table_equip)、
類型值(value)與關聯鍵欄位名稱(arg),供統一的
loadItems / saveItems 方法以不同策略操作同一套邏輯。
支援的來源包含:
INVENTORY:角色背包(以characterid關聯)STORAGE:帳號共用倉庫(以accountid關聯)CASHSHOP:現金商城購物車(以accountid關聯)HIRED_MERCHANT:僱傭商人貨架DUEY:快遞系統包裹MTS/MTS_TRANSFER:楓幣交易所(MTS)
載入時會透過 server.MapleItemInformationProvider 驗證每筆道具 ID 存在性;
登入快速路徑(login=true)僅載入 MapleInventoryType.EQUIPPED 格位。
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()loadItems(boolean login, int id) voidsaveItems(List<Pair<Item, MapleInventoryType>> items, int id) voidsaveItems(List<Pair<Item, MapleInventoryType>> items, Connection con, int id) static ItemLoaderReturns the enum constant of this class with the specified name.static ItemLoader[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVENTORY
-
STORAGE
-
CASHSHOP
-
HIRED_MERCHANT
-
DUEY
-
MTS
-
MTS_TRANSFER
-
-
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
-
getValue
public int getValue() -
loadItems
public Map<Long, Pair<Item, MapleInventoryType>> loadItems(boolean login, int id) throws SQLException - Throws:
SQLException
-
saveItems
- Throws:
SQLException
-
saveItems
public void saveItems(List<Pair<Item, MapleInventoryType>> items, Connection con, int id) throws SQLException - Throws:
SQLException
-