Skip to content

Commit 9e3dd7c

Browse files
committed
Replace the remaining enum usage with tables
1 parent 6b9c370 commit 9e3dd7c

File tree

4 files changed

+72
-103
lines changed

4 files changed

+72
-103
lines changed

methods/TrinityCore/GameObjectMethods.h

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,11 @@ namespace LuaGameObject
8585
* Returns the state of a [GameObject]
8686
* Below are client side [GOState]s off of 3.3.5a
8787
*
88-
* <pre>
89-
* enum GOState
90-
* {
91-
* GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open)
92-
* GO_STATE_READY = 1, // show in world as ready (closed door close)
93-
* GO_STATE_ACTIVE_ALTERNATIVE = 2 // show in world as used in alt way and not reset (closed door open by cannon fire)
94-
* };
95-
* </pre>
88+
* @table
89+
* @columns [GOState, ID, Comment]
90+
* @values [GO_STATE_ACTIVE, 0, "show in world as used and not reset (closed door open)"]
91+
* @values [GO_STATE_READY, 1, "show in world as ready (closed door close)"]
92+
* @values [GO_STATE_ACTIVE_ALTERNATIVE, 2, "show in world as used in alt way and not reset (closed door open by cannon fire)"]
9693
*
9794
* @return [GOState] goState
9895
*/
@@ -106,15 +103,12 @@ namespace LuaGameObject
106103
* Returns the [LootState] of a [GameObject]
107104
* Below are [LootState]s off of 3.3.5a
108105
*
109-
* <pre>
110-
* enum LootState
111-
* {
112-
* GO_NOT_READY = 0,
113-
* GO_READY, // can be ready but despawned, and then not possible activate until spawn
114-
* GO_ACTIVATED,
115-
* GO_JUST_DEACTIVATED
116-
* };
117-
* </pre>
106+
* @table
107+
* @columns [LootState, ID, Comment]
108+
* @values [GO_NOT_READY, 0, ""]
109+
* @values [GO_READY, 1, "can be ready but despawned, and then not possible activate until spawn"]
110+
* @values [GO_ACTIVATED, 2, ""]
111+
* @values [GO_JUST_DEACTIVATED, 3, ""]
118112
*
119113
* @return [LootState] lootState
120114
*/
@@ -164,14 +158,11 @@ namespace LuaGameObject
164158
/**
165159
* Sets the state of a [GameObject]
166160
*
167-
* <pre>
168-
* enum GOState
169-
* {
170-
* GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open)
171-
* GO_STATE_READY = 1, // show in world as ready (closed door close)
172-
* GO_STATE_ACTIVE_ALTERNATIVE = 2 // show in world as used in alt way and not reset (closed door open by cannon fire)
173-
* };
174-
* </pre>
161+
* @table
162+
* @columns [GOState, ID, Comment]
163+
* @values [GO_STATE_ACTIVE, 0, "show in world as used and not reset (closed door open)"]
164+
* @values [GO_STATE_READY, 1, "show in world as ready (closed door close)"]
165+
* @values [GO_STATE_ACTIVE_ALTERNATIVE, 2, "show in world as used in alt way and not reset (closed door open by cannon fire)"]
175166
*
176167
* @param [GOState] state : all available go states can be seen above
177168
*/
@@ -193,15 +184,12 @@ namespace LuaGameObject
193184
* Sets the [LootState] of a [GameObject]
194185
* Below are [LootState]s off of 3.3.5a
195186
*
196-
* <pre>
197-
* enum LootState
198-
* {
199-
* GO_NOT_READY = 0,
200-
* GO_READY, // can be ready but despawned, and then not possible activate until spawn
201-
* GO_ACTIVATED,
202-
* GO_JUST_DEACTIVATED
203-
* };
204-
* </pre>
187+
* @table
188+
* @columns [LootState, ID, Comment]
189+
* @values [GO_NOT_READY, 0, ""]
190+
* @values [GO_READY, 1, "can be ready but despawned, and then not possible activate until spawn"]
191+
* @values [GO_ACTIVATED, 2, ""]
192+
* @values [GO_JUST_DEACTIVATED, 3, ""]
205193
*
206194
* @param [LootState] state : all available loot states can be seen above
207195
*/

methods/TrinityCore/GroupMethods.h

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,11 @@ namespace LuaGroup
259259
/**
260260
* Returns the [Group] members' flags
261261
*
262-
* <pre>
263-
* enum GroupMemberFlags
264-
* {
265-
* MEMBER_FLAG_ASSISTANT = 1,
266-
* MEMBER_FLAG_MAINTANK = 2,
267-
* MEMBER_FLAG_MAINASSIST = 4
268-
* };
269-
* </pre>
262+
* @table
263+
* @columns [GroupMemberFlags, ID]
264+
* @values [MEMBER_FLAG_ASSISTANT, 1]
265+
* @values [MEMBER_FLAG_MAINTANK, 2]
266+
* @values [MEMBER_FLAG_MAINASSIST, 4]
270267
*
271268
* @param ObjectGuid guid : guid of the player
272269
* @return uint8 flags
@@ -315,15 +312,12 @@ namespace LuaGroup
315312
*
316313
* In multistate, this method is only available in the WORLD state
317314
*
318-
* <pre>
319-
* enum RemoveMethod
320-
* {
321-
* GROUP_REMOVEMETHOD_DEFAULT = 0,
322-
* GROUP_REMOVEMETHOD_KICK = 1,
323-
* GROUP_REMOVEMETHOD_LEAVE = 2,
324-
* GROUP_REMOVEMETHOD_KICK_LFG = 3
325-
* };
326-
* </pre>
315+
* @table
316+
* @columns [RemoveMethod, ID]
317+
* @values [GROUP_REMOVEMETHOD_DEFAULT, 0]
318+
* @values [GROUP_REMOVEMETHOD_KICK, 1]
319+
* @values [GROUP_REMOVEMETHOD_LEAVE, 2]
320+
* @values [GROUP_REMOVEMETHOD_KICK_LFG, 3]
327321
*
328322
* @param ObjectGuid guid : guid of the player to remove
329323
* @param [RemoveMethod] method : method used to remove the player
@@ -414,7 +408,6 @@ namespace LuaGroup
414408
* Converts the [Group] to a LFG group
415409
*
416410
* In multistate, this method is only available in the WORLD state
417-
*
418411
*/
419412
int ConvertToLFG(Eluna* /*E*/, Group* group)
420413
{
@@ -427,14 +420,11 @@ namespace LuaGroup
427420
*
428421
* In multistate, this method is only available in the WORLD state
429422
*
430-
* <pre>
431-
* enum GroupMemberFlags
432-
* {
433-
* MEMBER_FLAG_ASSISTANT = 1,
434-
* MEMBER_FLAG_MAINTANK = 2,
435-
* MEMBER_FLAG_MAINASSIST = 4
436-
* };
437-
* </pre>
423+
* @table
424+
* @columns [GroupMemberFlags, ID]
425+
* @values [MEMBER_FLAG_ASSISTANT, 1]
426+
* @values [MEMBER_FLAG_MAINTANK, 2]
427+
* @values [MEMBER_FLAG_MAINASSIST, 4]
438428
*
439429
* @param ObjectGuid target : GUID of the target
440430
* @param bool apply : add the `flag` if `true`, remove the `flag` otherwise

methods/TrinityCore/ItemMethods.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,17 @@ namespace LuaItem
232232
/**
233233
* Returns the chat link of the [Item]
234234
*
235-
* <pre>
236-
* enum LocaleConstant
237-
* {
238-
* LOCALE_enUS = 0,
239-
* LOCALE_koKR = 1,
240-
* LOCALE_frFR = 2,
241-
* LOCALE_deDE = 3,
242-
* LOCALE_zhCN = 4,
243-
* LOCALE_zhTW = 5,
244-
* LOCALE_esES = 6,
245-
* LOCALE_esMX = 7,
246-
* LOCALE_ruRU = 8
247-
* };
248-
* </pre>
235+
* @table
236+
* @columns [Locale, ID]
237+
* @values [LOCALE_enUS, 0]
238+
* @values [LOCALE_koKR, 1]
239+
* @values [LOCALE_frFR, 2]
240+
* @values [LOCALE_deDE, 3]
241+
* @values [LOCALE_zhCN, 4]
242+
* @values [LOCALE_zhTW, 5]
243+
* @values [LOCALE_esES, 6]
244+
* @values [LOCALE_esMX, 7]
245+
* @values [LOCALE_ruRU, 8]
249246
*
250247
* @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the [Item]'s name in
251248
* @return string itemLink

methods/TrinityCore/QuestMethods.h

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,29 @@ namespace LuaQuest
1616
* Returns 'true' if the [Quest] has the specified flag, false otherwise.
1717
* Below flags are based off of 3.3.5a. Subject to change.
1818
*
19-
* <pre>
20-
* enum QuestFlags
21-
* {
22-
* // Flags used at server and sent to client
23-
* QUEST_FLAGS_NONE = 0x0,
24-
* QUEST_FLAGS_STAY_ALIVE = 0x1, // Not used currently
25-
* QUEST_FLAGS_PARTY_ACCEPT = 0x2, // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
26-
* QUEST_FLAGS_EXPLORATION = 0x4, // Not used currently
27-
* QUEST_FLAGS_SHARABLE = 0x8, // Can be shared: Player::CanShareQuest()
28-
* QUEST_FLAGS_HAS_CONDITION = 0x10, // Not used currently
29-
* QUEST_FLAGS_HIDE_REWARD_POI = 0x20, // Not used currently: Unsure of content
30-
* QUEST_FLAGS_RAID = 0x40, // Not used currently
31-
* QUEST_FLAGS_TBC = 0x80, // Not used currently: Available if TBC expansion enabled only
32-
* QUEST_FLAGS_NO_MONEY_FROM_XP = 0x100, // Not used currently: Experience is not converted to gold at max level
33-
* QUEST_FLAGS_HIDDEN_REWARDS = 0x200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
34-
* QUEST_FLAGS_TRACKING = 0x400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
35-
* QUEST_FLAGS_DEPRECATE_REPUTATION = 0x800, // Not used currently
36-
* QUEST_FLAGS_DAILY = 0x1000, // Used to know quest is Daily one
37-
* QUEST_FLAGS_FLAGS_PVP = 0x2000, // Having this quest in log forces PvP flag
38-
* QUEST_FLAGS_UNAVAILABLE = 0x4000, // Used on quests that are not generically available
39-
* QUEST_FLAGS_WEEKLY = 0x8000,
40-
* QUEST_FLAGS_AUTOCOMPLETE = 0x10000, // auto complete
41-
* QUEST_FLAGS_DISPLAY_ITEM_IN_TRACKER = 0x20000, // Displays usable item in quest tracker
42-
* QUEST_FLAGS_OBJ_TEXT = 0x40000, // use Objective text as Complete text
43-
* QUEST_FLAGS_AUTO_ACCEPT = 0x80000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
44-
*
45-
* // ... 4.x added flags up to 0x80000000 - all unknown for now
46-
* };
47-
* </pre>
19+
* @table
20+
* @columns [QuestFlags, ID, Comment]
21+
* @values [QUEST_FLAGS_NONE, 0x0, ""]
22+
* @values [QUEST_FLAGS_STAY_ALIVE, 0x1, "Not used currently"]
23+
* @values [QUEST_FLAGS_PARTY_ACCEPT, 0x2, "Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT"]
24+
* @values [QUEST_FLAGS_EXPLORATION, 0x4, "Not used currently"]
25+
* @values [QUEST_FLAGS_SHARABLE, 0x8, "Can be shared: Player::CanShareQuest()"]
26+
* @values [QUEST_FLAGS_HAS_CONDITION, 0x10, "Not used currently"]
27+
* @values [QUEST_FLAGS_HIDE_REWARD_POI, 0x20, "Not used currently: Unsure of content"]
28+
* @values [QUEST_FLAGS_RAID, 0x40, "Not used currently"]
29+
* @values [QUEST_FLAGS_TBC, 0x80, "Not used currently: Available if TBC expansion enabled only"]
30+
* @values [QUEST_FLAGS_NO_MONEY_FROM_XP, 0x100, "Not used currently: Experience is not converted to gold at max level"]
31+
* @values [QUEST_FLAGS_HIDDEN_REWARDS, 0x200, "Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))"]
32+
* @values [QUEST_FLAGS_TRACKING, 0x400, "These quests are automatically rewarded on quest complete and they will never appear in quest log client side."]
33+
* @values [QUEST_FLAGS_DEPRECATE_REPUTATION, 0x800, "Not used currently"]
34+
* @values [QUEST_FLAGS_DAILY, 0x1000, "Used to know quest is Daily one"]
35+
* @values [QUEST_FLAGS_FLAGS_PVP, 0x2000, "Having this quest in log forces PvP flag"]
36+
* @values [QUEST_FLAGS_UNAVAILABLE, 0x4000, "Used on quests that are not generically available"]
37+
* @values [QUEST_FLAGS_WEEKLY, 0x8000, ""]
38+
* @values [QUEST_FLAGS_AUTOCOMPLETE, 0x10000, "auto complete"]
39+
* @values [QUEST_FLAGS_DISPLAY_ITEM_IN_TRACKER, 0x20000, "Displays usable item in quest tracker"]
40+
* @values [QUEST_FLAGS_OBJ_TEXT, 0x40000, "use Objective text as Complete text"]
41+
* @values [QUEST_FLAGS_AUTO_ACCEPT, 0x80000, "The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future."]
4842
*
4943
* @param [QuestFlags] flag : all available flags can be seen above
5044
* @return bool hasFlag

0 commit comments

Comments
 (0)