diff --git a/Makefile.am b/Makefile.am index 85033b16..d898a08a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -332,6 +332,7 @@ test_runner_SOURCES = \ tests/dbbitarray.cpp \ tests/dbstring.cpp \ tests/doctest.h \ + tests/enum_tags.cpp \ tests/flag_set.cpp \ tests/test_main.cpp \ tests/time_stamp.cpp \ diff --git a/generator/generate.py b/generator/generate.py index f4c7484c..4d4f898d 100755 --- a/generator/generate.py +++ b/generator/generate.py @@ -384,14 +384,6 @@ def type_is_array_of_struct(ty): m = re.match(r'(Vector|Array|DBArray)<(.*)>', ty) return m and type_is_struct(m.group(2)) -def is_monotonic_from_0(enum): - expected = 0 - for (val, idx) in enum: - if int(idx) != expected: - return False - expected += 1 - return True - def openToRender(path): subdir = os.path.dirname(path) if not os.path.exists(subdir): @@ -507,7 +499,6 @@ def main(argv): env.filters["num_flags"] = num_flags env.filters["flag_size"] = flag_size env.filters["flag_set"] = flag_set - env.tests['monotonic_from_0'] = is_monotonic_from_0 env.tests['is_db_string'] = type_is_db_string env.tests['is_array'] = type_is_array env.tests['is_array_of_struct'] = type_is_array_of_struct diff --git a/generator/templates/rpg_header.tmpl b/generator/templates/rpg_header.tmpl index 858ff32a..1b792df6 100644 --- a/generator/templates/rpg_header.tmpl +++ b/generator/templates/rpg_header.tmpl @@ -46,13 +46,15 @@ namespace rpg { {%- endif %} = {{ field.1 }}{%- if not loop.last %},{% endif %} {%- endfor %} }; - {%- if enum is monotonic_from_0 %} - static constexpr auto k{{ name }}Tags = lcf::makeEnumTags<{{name}}>( + static constexpr auto k{{ name }}Tags = lcf::EnumTags{ {%- for field in enum %} - "{{ field.0 }}"{%- if not loop.last %},{% endif %} + {%- if name != "Code" %} + {{ name }}_{{ field.0 }}, "{{ field.0 }}"{%- if not loop.last %},{% endif %} + {%- else %} + {{ name }}::{{ field.0 }}, "{{ field.0 }}"{%- if not loop.last %},{% endif %} + {%- endif %} {%- endfor %} - ); - {%- endif %} + }; {%- endfor %} {% endif %} {%- for func in functions[struct_name] %} diff --git a/src/generated/lcf/rpg/animation.h b/src/generated/lcf/rpg/animation.h index 66e3fd0a..9f9480ac 100644 --- a/src/generated/lcf/rpg/animation.h +++ b/src/generated/lcf/rpg/animation.h @@ -33,20 +33,20 @@ namespace rpg { Scope_target = 0, Scope_screen = 1 }; - static constexpr auto kScopeTags = lcf::makeEnumTags( - "target", - "screen" - ); + static constexpr auto kScopeTags = lcf::EnumTags{ + Scope_target, "target", + Scope_screen, "screen" + }; enum Position { Position_up = 0, Position_middle = 1, Position_down = 2 }; - static constexpr auto kPositionTags = lcf::makeEnumTags( - "up", - "middle", - "down" - ); + static constexpr auto kPositionTags = lcf::EnumTags{ + Position_up, "up", + Position_middle, "middle", + Position_down, "down" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/animationtiming.h b/src/generated/lcf/rpg/animationtiming.h index 52d688cb..fde06cdb 100644 --- a/src/generated/lcf/rpg/animationtiming.h +++ b/src/generated/lcf/rpg/animationtiming.h @@ -32,21 +32,21 @@ namespace rpg { FlashScope_target = 1, FlashScope_screen = 2 }; - static constexpr auto kFlashScopeTags = lcf::makeEnumTags( - "nothing", - "target", - "screen" - ); + static constexpr auto kFlashScopeTags = lcf::EnumTags{ + FlashScope_nothing, "nothing", + FlashScope_target, "target", + FlashScope_screen, "screen" + }; enum ScreenShake { ScreenShake_nothing = 0, ScreenShake_target = 1, ScreenShake_screen = 2 }; - static constexpr auto kScreenShakeTags = lcf::makeEnumTags( - "nothing", - "target", - "screen" - ); + static constexpr auto kScreenShakeTags = lcf::EnumTags{ + ScreenShake_nothing, "nothing", + ScreenShake_target, "target", + ScreenShake_screen, "screen" + }; int ID = 0; int32_t frame = 0; diff --git a/src/generated/lcf/rpg/attribute.h b/src/generated/lcf/rpg/attribute.h index e1f6ee5d..d7fbddb1 100644 --- a/src/generated/lcf/rpg/attribute.h +++ b/src/generated/lcf/rpg/attribute.h @@ -31,10 +31,10 @@ namespace rpg { Type_physical = 0, Type_magical = 1 }; - static constexpr auto kTypeTags = lcf::makeEnumTags( - "physical", - "magical" - ); + static constexpr auto kTypeTags = lcf::EnumTags{ + Type_physical, "physical", + Type_magical, "magical" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/battlecommand.h b/src/generated/lcf/rpg/battlecommand.h index 750624da..4bb72f89 100644 --- a/src/generated/lcf/rpg/battlecommand.h +++ b/src/generated/lcf/rpg/battlecommand.h @@ -35,15 +35,15 @@ namespace rpg { Type_escape = 5, Type_special = 6 }; - static constexpr auto kTypeTags = lcf::makeEnumTags( - "attack", - "skill", - "subskill", - "defense", - "item", - "escape", - "special" - ); + static constexpr auto kTypeTags = lcf::EnumTags{ + Type_attack, "attack", + Type_skill, "skill", + Type_subskill, "subskill", + Type_defense, "defense", + Type_item, "item", + Type_escape, "escape", + Type_special, "special" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/battlecommands.h b/src/generated/lcf/rpg/battlecommands.h index a4e0cbe9..f7add164 100644 --- a/src/generated/lcf/rpg/battlecommands.h +++ b/src/generated/lcf/rpg/battlecommands.h @@ -32,44 +32,44 @@ namespace rpg { Placement_manual = 0, Placement_automatic = 1 }; - static constexpr auto kPlacementTags = lcf::makeEnumTags( - "manual", - "automatic" - ); + static constexpr auto kPlacementTags = lcf::EnumTags{ + Placement_manual, "manual", + Placement_automatic, "automatic" + }; enum RowShown { RowShown_front = 0, RowShown_back = 1 }; - static constexpr auto kRowShownTags = lcf::makeEnumTags( - "front", - "back" - ); + static constexpr auto kRowShownTags = lcf::EnumTags{ + RowShown_front, "front", + RowShown_back, "back" + }; enum BattleType { BattleType_traditional = 0, BattleType_alternative = 1, BattleType_gauge = 2 }; - static constexpr auto kBattleTypeTags = lcf::makeEnumTags( - "traditional", - "alternative", - "gauge" - ); + static constexpr auto kBattleTypeTags = lcf::EnumTags{ + BattleType_traditional, "traditional", + BattleType_alternative, "alternative", + BattleType_gauge, "gauge" + }; enum WindowSize { WindowSize_large = 0, WindowSize_small = 1 }; - static constexpr auto kWindowSizeTags = lcf::makeEnumTags( - "large", - "small" - ); + static constexpr auto kWindowSizeTags = lcf::EnumTags{ + WindowSize_large, "large", + WindowSize_small, "small" + }; enum Transparency { Transparency_opaque = 0, Transparency_transparent = 1 }; - static constexpr auto kTransparencyTags = lcf::makeEnumTags( - "opaque", - "transparent" - ); + static constexpr auto kTransparencyTags = lcf::EnumTags{ + Transparency_opaque, "opaque", + Transparency_transparent, "transparent" + }; enum Facing { Facing_retain = 0, Facing_up = 1, @@ -77,13 +77,13 @@ namespace rpg { Facing_down = 3, Facing_left = 4 }; - static constexpr auto kFacingTags = lcf::makeEnumTags( - "retain", - "up", - "right", - "down", - "left" - ); + static constexpr auto kFacingTags = lcf::EnumTags{ + Facing_retain, "retain", + Facing_up, "up", + Facing_right, "right", + Facing_down, "down", + Facing_left, "left" + }; int32_t placement = 0; bool death_handler_unused = 0; diff --git a/src/generated/lcf/rpg/battleranimation.h b/src/generated/lcf/rpg/battleranimation.h index 091adaea..363bf726 100644 --- a/src/generated/lcf/rpg/battleranimation.h +++ b/src/generated/lcf/rpg/battleranimation.h @@ -34,6 +34,11 @@ namespace rpg { Speed_medium = 14, Speed_fast = 8 }; + static constexpr auto kSpeedTags = lcf::EnumTags{ + Speed_slow, "slow", + Speed_medium, "medium", + Speed_fast, "fast" + }; enum Pose { Pose_Idle = 0, Pose_AttackRight = 1, @@ -48,20 +53,20 @@ namespace rpg { Pose_Victory = 10, Pose_Item = 11 }; - static constexpr auto kPoseTags = lcf::makeEnumTags( - "Idle", - "AttackRight", - "AttackLeft", - "Skill", - "Dead", - "Damage", - "Dazed", - "Defend", - "WalkLeft", - "WalkRight", - "Victory", - "Item" - ); + static constexpr auto kPoseTags = lcf::EnumTags{ + Pose_Idle, "Idle", + Pose_AttackRight, "AttackRight", + Pose_AttackLeft, "AttackLeft", + Pose_Skill, "Skill", + Pose_Dead, "Dead", + Pose_Damage, "Damage", + Pose_Dazed, "Dazed", + Pose_Defend, "Defend", + Pose_WalkLeft, "WalkLeft", + Pose_WalkRight, "WalkRight", + Pose_Victory, "Victory", + Pose_Item, "Item" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/battleranimationitemskill.h b/src/generated/lcf/rpg/battleranimationitemskill.h index 28b5f533..08631fce 100644 --- a/src/generated/lcf/rpg/battleranimationitemskill.h +++ b/src/generated/lcf/rpg/battleranimationitemskill.h @@ -31,39 +31,39 @@ namespace rpg { Speed_medium = 1, Speed_slow = 2 }; - static constexpr auto kSpeedTags = lcf::makeEnumTags( - "fast", - "medium", - "slow" - ); + static constexpr auto kSpeedTags = lcf::EnumTags{ + Speed_fast, "fast", + Speed_medium, "medium", + Speed_slow, "slow" + }; enum AnimType { AnimType_weapon = 0, AnimType_battle = 1 }; - static constexpr auto kAnimTypeTags = lcf::makeEnumTags( - "weapon", - "battle" - ); + static constexpr auto kAnimTypeTags = lcf::EnumTags{ + AnimType_weapon, "weapon", + AnimType_battle, "battle" + }; enum Movement { Movement_none = 0, Movement_step = 1, Movement_jump = 2, Movement_move = 3 }; - static constexpr auto kMovementTags = lcf::makeEnumTags( - "none", - "step", - "jump", - "move" - ); + static constexpr auto kMovementTags = lcf::EnumTags{ + Movement_none, "none", + Movement_step, "step", + Movement_jump, "jump", + Movement_move, "move" + }; enum Afterimage { Afterimage_none = 0, Afterimage_add = 1 }; - static constexpr auto kAfterimageTags = lcf::makeEnumTags( - "none", - "add" - ); + static constexpr auto kAfterimageTags = lcf::EnumTags{ + Afterimage_none, "none", + Afterimage_add, "add" + }; int ID = 0; int32_t unknown02 = 0; diff --git a/src/generated/lcf/rpg/battleranimationpose.h b/src/generated/lcf/rpg/battleranimationpose.h index 13a44473..abad39af 100644 --- a/src/generated/lcf/rpg/battleranimationpose.h +++ b/src/generated/lcf/rpg/battleranimationpose.h @@ -31,10 +31,10 @@ namespace rpg { AnimType_character = 0, AnimType_battle = 1 }; - static constexpr auto kAnimTypeTags = lcf::makeEnumTags( - "character", - "battle" - ); + static constexpr auto kAnimTypeTags = lcf::EnumTags{ + AnimType_character, "character", + AnimType_battle, "battle" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/chipset.h b/src/generated/lcf/rpg/chipset.h index 2c33c3a0..8ee8fd03 100644 --- a/src/generated/lcf/rpg/chipset.h +++ b/src/generated/lcf/rpg/chipset.h @@ -32,10 +32,10 @@ namespace rpg { AnimType_reciprocating = 0, AnimType_cyclic = 1 }; - static constexpr auto kAnimTypeTags = lcf::makeEnumTags( - "reciprocating", - "cyclic" - ); + static constexpr auto kAnimTypeTags = lcf::EnumTags{ + AnimType_reciprocating, "reciprocating", + AnimType_cyclic, "cyclic" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/commonevent.h b/src/generated/lcf/rpg/commonevent.h index b47afbfb..55eb655a 100644 --- a/src/generated/lcf/rpg/commonevent.h +++ b/src/generated/lcf/rpg/commonevent.h @@ -34,6 +34,11 @@ namespace rpg { Trigger_parallel = 4, Trigger_call = 5 }; + static constexpr auto kTriggerTags = lcf::EnumTags{ + Trigger_automatic, "automatic", + Trigger_parallel, "parallel", + Trigger_call, "call" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/enemyaction.h b/src/generated/lcf/rpg/enemyaction.h index 92ebfc6a..2b2b3130 100644 --- a/src/generated/lcf/rpg/enemyaction.h +++ b/src/generated/lcf/rpg/enemyaction.h @@ -31,11 +31,11 @@ namespace rpg { Kind_skill = 1, Kind_transformation = 2 }; - static constexpr auto kKindTags = lcf::makeEnumTags( - "basic", - "skill", - "transformation" - ); + static constexpr auto kKindTags = lcf::EnumTags{ + Kind_basic, "basic", + Kind_skill, "skill", + Kind_transformation, "transformation" + }; enum Basic { Basic_attack = 0, Basic_dual_attack = 1, @@ -46,16 +46,16 @@ namespace rpg { Basic_escape = 6, Basic_nothing = 7 }; - static constexpr auto kBasicTags = lcf::makeEnumTags( - "attack", - "dual_attack", - "defense", - "observe", - "charge", - "autodestruction", - "escape", - "nothing" - ); + static constexpr auto kBasicTags = lcf::EnumTags{ + Basic_attack, "attack", + Basic_dual_attack, "dual_attack", + Basic_defense, "defense", + Basic_observe, "observe", + Basic_charge, "charge", + Basic_autodestruction, "autodestruction", + Basic_escape, "escape", + Basic_nothing, "nothing" + }; enum ConditionType { ConditionType_always = 0, ConditionType_switch = 1, @@ -66,16 +66,16 @@ namespace rpg { ConditionType_party_lvl = 6, ConditionType_party_fatigue = 7 }; - static constexpr auto kConditionTypeTags = lcf::makeEnumTags( - "always", - "switch", - "turn", - "actors", - "hp", - "sp", - "party_lvl", - "party_fatigue" - ); + static constexpr auto kConditionTypeTags = lcf::EnumTags{ + ConditionType_always, "always", + ConditionType_switch, "switch", + ConditionType_turn, "turn", + ConditionType_actors, "actors", + ConditionType_hp, "hp", + ConditionType_sp, "sp", + ConditionType_party_lvl, "party_lvl", + ConditionType_party_fatigue, "party_fatigue" + }; int ID = 0; int32_t kind = 0; diff --git a/src/generated/lcf/rpg/eventcommand.h b/src/generated/lcf/rpg/eventcommand.h index a8e59e3b..f54c9f05 100644 --- a/src/generated/lcf/rpg/eventcommand.h +++ b/src/generated/lcf/rpg/eventcommand.h @@ -184,6 +184,162 @@ namespace rpg { Maniac_EditTile = 3028, Maniac_ControlTextProcessing = 3029 }; + static constexpr auto kCodeTags = lcf::EnumTags{ + Code::END, "END", + Code::CallCommonEvent, "CallCommonEvent", + Code::ForceFlee, "ForceFlee", + Code::EnableCombo, "EnableCombo", + Code::ChangeClass, "ChangeClass", + Code::ChangeBattleCommands, "ChangeBattleCommands", + Code::OpenLoadMenu, "OpenLoadMenu", + Code::ExitGame, "ExitGame", + Code::ToggleAtbMode, "ToggleAtbMode", + Code::ToggleFullscreen, "ToggleFullscreen", + Code::OpenVideoOptions, "OpenVideoOptions", + Code::ShowMessage, "ShowMessage", + Code::MessageOptions, "MessageOptions", + Code::ChangeFaceGraphic, "ChangeFaceGraphic", + Code::ShowChoice, "ShowChoice", + Code::InputNumber, "InputNumber", + Code::ControlSwitches, "ControlSwitches", + Code::ControlVars, "ControlVars", + Code::TimerOperation, "TimerOperation", + Code::ChangeGold, "ChangeGold", + Code::ChangeItems, "ChangeItems", + Code::ChangePartyMembers, "ChangePartyMembers", + Code::ChangeExp, "ChangeExp", + Code::ChangeLevel, "ChangeLevel", + Code::ChangeParameters, "ChangeParameters", + Code::ChangeSkills, "ChangeSkills", + Code::ChangeEquipment, "ChangeEquipment", + Code::ChangeHP, "ChangeHP", + Code::ChangeSP, "ChangeSP", + Code::ChangeCondition, "ChangeCondition", + Code::FullHeal, "FullHeal", + Code::SimulatedAttack, "SimulatedAttack", + Code::ChangeHeroName, "ChangeHeroName", + Code::ChangeHeroTitle, "ChangeHeroTitle", + Code::ChangeSpriteAssociation, "ChangeSpriteAssociation", + Code::ChangeActorFace, "ChangeActorFace", + Code::ChangeVehicleGraphic, "ChangeVehicleGraphic", + Code::ChangeSystemBGM, "ChangeSystemBGM", + Code::ChangeSystemSFX, "ChangeSystemSFX", + Code::ChangeSystemGraphics, "ChangeSystemGraphics", + Code::ChangeScreenTransitions, "ChangeScreenTransitions", + Code::EnemyEncounter, "EnemyEncounter", + Code::OpenShop, "OpenShop", + Code::ShowInn, "ShowInn", + Code::EnterHeroName, "EnterHeroName", + Code::Teleport, "Teleport", + Code::MemorizeLocation, "MemorizeLocation", + Code::RecallToLocation, "RecallToLocation", + Code::EnterExitVehicle, "EnterExitVehicle", + Code::SetVehicleLocation, "SetVehicleLocation", + Code::ChangeEventLocation, "ChangeEventLocation", + Code::TradeEventLocations, "TradeEventLocations", + Code::StoreTerrainID, "StoreTerrainID", + Code::StoreEventID, "StoreEventID", + Code::EraseScreen, "EraseScreen", + Code::ShowScreen, "ShowScreen", + Code::TintScreen, "TintScreen", + Code::FlashScreen, "FlashScreen", + Code::ShakeScreen, "ShakeScreen", + Code::PanScreen, "PanScreen", + Code::WeatherEffects, "WeatherEffects", + Code::ShowPicture, "ShowPicture", + Code::MovePicture, "MovePicture", + Code::ErasePicture, "ErasePicture", + Code::ShowBattleAnimation, "ShowBattleAnimation", + Code::PlayerVisibility, "PlayerVisibility", + Code::FlashSprite, "FlashSprite", + Code::MoveEvent, "MoveEvent", + Code::ProceedWithMovement, "ProceedWithMovement", + Code::HaltAllMovement, "HaltAllMovement", + Code::Wait, "Wait", + Code::PlayBGM, "PlayBGM", + Code::FadeOutBGM, "FadeOutBGM", + Code::MemorizeBGM, "MemorizeBGM", + Code::PlayMemorizedBGM, "PlayMemorizedBGM", + Code::PlaySound, "PlaySound", + Code::PlayMovie, "PlayMovie", + Code::KeyInputProc, "KeyInputProc", + Code::ChangeMapTileset, "ChangeMapTileset", + Code::ChangePBG, "ChangePBG", + Code::ChangeEncounterSteps, "ChangeEncounterSteps", + Code::TileSubstitution, "TileSubstitution", + Code::TeleportTargets, "TeleportTargets", + Code::ChangeTeleportAccess, "ChangeTeleportAccess", + Code::EscapeTarget, "EscapeTarget", + Code::ChangeEscapeAccess, "ChangeEscapeAccess", + Code::OpenSaveMenu, "OpenSaveMenu", + Code::ChangeSaveAccess, "ChangeSaveAccess", + Code::OpenMainMenu, "OpenMainMenu", + Code::ChangeMainMenuAccess, "ChangeMainMenuAccess", + Code::ConditionalBranch, "ConditionalBranch", + Code::Label, "Label", + Code::JumpToLabel, "JumpToLabel", + Code::Loop, "Loop", + Code::BreakLoop, "BreakLoop", + Code::EndEventProcessing, "EndEventProcessing", + Code::EraseEvent, "EraseEvent", + Code::CallEvent, "CallEvent", + Code::Comment, "Comment", + Code::GameOver, "GameOver", + Code::ReturntoTitleScreen, "ReturntoTitleScreen", + Code::ChangeMonsterHP, "ChangeMonsterHP", + Code::ChangeMonsterMP, "ChangeMonsterMP", + Code::ChangeMonsterCondition, "ChangeMonsterCondition", + Code::ShowHiddenMonster, "ShowHiddenMonster", + Code::ChangeBattleBG, "ChangeBattleBG", + Code::ShowBattleAnimation_B, "ShowBattleAnimation_B", + Code::ConditionalBranch_B, "ConditionalBranch_B", + Code::TerminateBattle, "TerminateBattle", + Code::ShowMessage_2, "ShowMessage_2", + Code::ShowChoiceOption, "ShowChoiceOption", + Code::ShowChoiceEnd, "ShowChoiceEnd", + Code::VictoryHandler, "VictoryHandler", + Code::EscapeHandler, "EscapeHandler", + Code::DefeatHandler, "DefeatHandler", + Code::EndBattle, "EndBattle", + Code::Transaction, "Transaction", + Code::NoTransaction, "NoTransaction", + Code::EndShop, "EndShop", + Code::Stay, "Stay", + Code::NoStay, "NoStay", + Code::EndInn, "EndInn", + Code::ElseBranch, "ElseBranch", + Code::EndBranch, "EndBranch", + Code::EndLoop, "EndLoop", + Code::Comment_2, "Comment_2", + Code::ElseBranch_B, "ElseBranch_B", + Code::EndBranch_B, "EndBranch_B", + Code::Maniac_GetSaveInfo, "Maniac_GetSaveInfo", + Code::Maniac_Save, "Maniac_Save", + Code::Maniac_Load, "Maniac_Load", + Code::Maniac_EndLoadProcess, "Maniac_EndLoadProcess", + Code::Maniac_GetMousePosition, "Maniac_GetMousePosition", + Code::Maniac_SetMousePosition, "Maniac_SetMousePosition", + Code::Maniac_ShowStringPicture, "Maniac_ShowStringPicture", + Code::Maniac_GetPictureInfo, "Maniac_GetPictureInfo", + Code::Maniac_ControlBattle, "Maniac_ControlBattle", + Code::Maniac_ControlAtbGauge, "Maniac_ControlAtbGauge", + Code::Maniac_ChangeBattleCommandEx, "Maniac_ChangeBattleCommandEx", + Code::Maniac_GetBattleInfo, "Maniac_GetBattleInfo", + Code::Maniac_ControlVarArray, "Maniac_ControlVarArray", + Code::Maniac_KeyInputProcEx, "Maniac_KeyInputProcEx", + Code::Maniac_RewriteMap, "Maniac_RewriteMap", + Code::Maniac_ControlGlobalSave, "Maniac_ControlGlobalSave", + Code::Maniac_ChangePictureId, "Maniac_ChangePictureId", + Code::Maniac_SetGameOption, "Maniac_SetGameOption", + Code::Maniac_CallCommand, "Maniac_CallCommand", + Code::Maniac_ControlStrings, "Maniac_ControlStrings", + Code::Maniac_GetGameInfo, "Maniac_GetGameInfo", + Code::Maniac_EditPicture, "Maniac_EditPicture", + Code::Maniac_WritePicture, "Maniac_WritePicture", + Code::Maniac_AddMoveRoute, "Maniac_AddMoveRoute", + Code::Maniac_EditTile, "Maniac_EditTile", + Code::Maniac_ControlTextProcessing, "Maniac_ControlTextProcessing" + }; int32_t code = 0; int32_t indent = 0; diff --git a/src/generated/lcf/rpg/eventpage.h b/src/generated/lcf/rpg/eventpage.h index 2b79f9fe..1b4f603a 100644 --- a/src/generated/lcf/rpg/eventpage.h +++ b/src/generated/lcf/rpg/eventpage.h @@ -37,24 +37,24 @@ namespace rpg { Direction_down = 2, Direction_left = 3 }; - static constexpr auto kDirectionTags = lcf::makeEnumTags( - "up", - "right", - "down", - "left" - ); + static constexpr auto kDirectionTags = lcf::EnumTags{ + Direction_up, "up", + Direction_right, "right", + Direction_down, "down", + Direction_left, "left" + }; enum Frame { Frame_left = 0, Frame_middle = 1, Frame_right = 2, Frame_middle2 = 3 }; - static constexpr auto kFrameTags = lcf::makeEnumTags( - "left", - "middle", - "right", - "middle2" - ); + static constexpr auto kFrameTags = lcf::EnumTags{ + Frame_left, "left", + Frame_middle, "middle", + Frame_right, "right", + Frame_middle2, "middle2" + }; enum MoveType { MoveType_stationary = 0, MoveType_random = 1, @@ -64,15 +64,15 @@ namespace rpg { MoveType_away = 5, MoveType_custom = 6 }; - static constexpr auto kMoveTypeTags = lcf::makeEnumTags( - "stationary", - "random", - "vertical", - "horizontal", - "toward", - "away", - "custom" - ); + static constexpr auto kMoveTypeTags = lcf::EnumTags{ + MoveType_stationary, "stationary", + MoveType_random, "random", + MoveType_vertical, "vertical", + MoveType_horizontal, "horizontal", + MoveType_toward, "toward", + MoveType_away, "away", + MoveType_custom, "custom" + }; enum Trigger { Trigger_action = 0, Trigger_touched = 1, @@ -80,23 +80,23 @@ namespace rpg { Trigger_auto_start = 3, Trigger_parallel = 4 }; - static constexpr auto kTriggerTags = lcf::makeEnumTags( - "action", - "touched", - "collision", - "auto_start", - "parallel" - ); + static constexpr auto kTriggerTags = lcf::EnumTags{ + Trigger_action, "action", + Trigger_touched, "touched", + Trigger_collision, "collision", + Trigger_auto_start, "auto_start", + Trigger_parallel, "parallel" + }; enum Layers { Layers_below = 0, Layers_same = 1, Layers_above = 2 }; - static constexpr auto kLayersTags = lcf::makeEnumTags( - "below", - "same", - "above" - ); + static constexpr auto kLayersTags = lcf::EnumTags{ + Layers_below, "below", + Layers_same, "same", + Layers_above, "above" + }; enum AnimType { AnimType_non_continuous = 0, AnimType_continuous = 1, @@ -106,15 +106,15 @@ namespace rpg { AnimType_spin = 5, AnimType_step_frame_fix = 6 }; - static constexpr auto kAnimTypeTags = lcf::makeEnumTags( - "non_continuous", - "continuous", - "fixed_non_continuous", - "fixed_continuous", - "fixed_graphic", - "spin", - "step_frame_fix" - ); + static constexpr auto kAnimTypeTags = lcf::EnumTags{ + AnimType_non_continuous, "non_continuous", + AnimType_continuous, "continuous", + AnimType_fixed_non_continuous, "fixed_non_continuous", + AnimType_fixed_continuous, "fixed_continuous", + AnimType_fixed_graphic, "fixed_graphic", + AnimType_spin, "spin", + AnimType_step_frame_fix, "step_frame_fix" + }; enum MoveSpeed { MoveSpeed_eighth = 1, MoveSpeed_quarter = 2, @@ -123,6 +123,14 @@ namespace rpg { MoveSpeed_double = 5, MoveSpeed_fourfold = 6 }; + static constexpr auto kMoveSpeedTags = lcf::EnumTags{ + MoveSpeed_eighth, "eighth", + MoveSpeed_quarter, "quarter", + MoveSpeed_half, "half", + MoveSpeed_normal, "normal", + MoveSpeed_double, "double", + MoveSpeed_fourfold, "fourfold" + }; enum ManiacEventInfo { ManiacEventInfo_action = 0, ManiacEventInfo_touched = 1, @@ -136,6 +144,19 @@ namespace rpg { ManiacEventInfo_common_event = 32, ManiacEventInfo_battle_event = 64 }; + static constexpr auto kManiacEventInfoTags = lcf::EnumTags{ + ManiacEventInfo_action, "action", + ManiacEventInfo_touched, "touched", + ManiacEventInfo_collision, "collision", + ManiacEventInfo_auto_start, "auto_start", + ManiacEventInfo_parallel, "parallel", + ManiacEventInfo_called, "called", + ManiacEventInfo_battle_start, "battle_start", + ManiacEventInfo_battle_parallel, "battle_parallel", + ManiacEventInfo_map_event, "map_event", + ManiacEventInfo_common_event, "common_event", + ManiacEventInfo_battle_event, "battle_event" + }; int ID = 0; EventPageCondition condition; diff --git a/src/generated/lcf/rpg/eventpagecondition.h b/src/generated/lcf/rpg/eventpagecondition.h index 30939e29..f5409f9f 100644 --- a/src/generated/lcf/rpg/eventpagecondition.h +++ b/src/generated/lcf/rpg/eventpagecondition.h @@ -35,14 +35,14 @@ namespace rpg { Comparison_less = 4, Comparison_not_equal = 5 }; - static constexpr auto kComparisonTags = lcf::makeEnumTags( - "equal", - "greater_equal", - "less_equal", - "greater", - "less", - "not_equal" - ); + static constexpr auto kComparisonTags = lcf::EnumTags{ + Comparison_equal, "equal", + Comparison_greater_equal, "greater_equal", + Comparison_less_equal, "less_equal", + Comparison_greater, "greater", + Comparison_less, "less", + Comparison_not_equal, "not_equal" + }; struct Flags { union { diff --git a/src/generated/lcf/rpg/item.h b/src/generated/lcf/rpg/item.h index a7ee0b7c..08d8662c 100644 --- a/src/generated/lcf/rpg/item.h +++ b/src/generated/lcf/rpg/item.h @@ -46,39 +46,39 @@ namespace rpg { Type_special = 9, Type_switch = 10 }; - static constexpr auto kTypeTags = lcf::makeEnumTags( - "normal", - "weapon", - "shield", - "armor", - "helmet", - "accessory", - "medicine", - "book", - "material", - "special", - "switch" - ); + static constexpr auto kTypeTags = lcf::EnumTags{ + Type_normal, "normal", + Type_weapon, "weapon", + Type_shield, "shield", + Type_armor, "armor", + Type_helmet, "helmet", + Type_accessory, "accessory", + Type_medicine, "medicine", + Type_book, "book", + Type_material, "material", + Type_special, "special", + Type_switch, "switch" + }; enum Trajectory { Trajectory_straight = 0, Trajectory_return = 1 }; - static constexpr auto kTrajectoryTags = lcf::makeEnumTags( - "straight", - "return" - ); + static constexpr auto kTrajectoryTags = lcf::EnumTags{ + Trajectory_straight, "straight", + Trajectory_return, "return" + }; enum Target { Target_single = 0, Target_center = 1, Target_simultaneous = 2, Target_sequential = 3 }; - static constexpr auto kTargetTags = lcf::makeEnumTags( - "single", - "center", - "simultaneous", - "sequential" - ); + static constexpr auto kTargetTags = lcf::EnumTags{ + Target_single, "single", + Target_center, "center", + Target_simultaneous, "simultaneous", + Target_sequential, "sequential" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/map.h b/src/generated/lcf/rpg/map.h index 5c9ab926..7c6268a1 100644 --- a/src/generated/lcf/rpg/map.h +++ b/src/generated/lcf/rpg/map.h @@ -36,32 +36,32 @@ namespace rpg { ScrollType_horizontal = 2, ScrollType_both = 3 }; - static constexpr auto kScrollTypeTags = lcf::makeEnumTags( - "none", - "vertical", - "horizontal", - "both" - ); + static constexpr auto kScrollTypeTags = lcf::EnumTags{ + ScrollType_none, "none", + ScrollType_vertical, "vertical", + ScrollType_horizontal, "horizontal", + ScrollType_both, "both" + }; enum GeneratorMode { GeneratorMode_single_passage = 0, GeneratorMode_linked_rooms = 1, GeneratorMode_maze_passage = 2, GeneratorMode_open_room = 3 }; - static constexpr auto kGeneratorModeTags = lcf::makeEnumTags( - "single_passage", - "linked_rooms", - "maze_passage", - "open_room" - ); + static constexpr auto kGeneratorModeTags = lcf::EnumTags{ + GeneratorMode_single_passage, "single_passage", + GeneratorMode_linked_rooms, "linked_rooms", + GeneratorMode_maze_passage, "maze_passage", + GeneratorMode_open_room, "open_room" + }; enum GeneratorTiles { GeneratorTiles_one = 0, GeneratorTiles_two = 1 }; - static constexpr auto kGeneratorTilesTags = lcf::makeEnumTags( - "one", - "two" - ); + static constexpr auto kGeneratorTilesTags = lcf::EnumTags{ + GeneratorTiles_one, "one", + GeneratorTiles_two, "two" + }; int32_t chipset_id = 1; int32_t width = 20; diff --git a/src/generated/lcf/rpg/mapinfo.h b/src/generated/lcf/rpg/mapinfo.h index 58915f4f..defb5be4 100644 --- a/src/generated/lcf/rpg/mapinfo.h +++ b/src/generated/lcf/rpg/mapinfo.h @@ -36,31 +36,31 @@ namespace rpg { MusicType_event = 1, MusicType_specific = 2 }; - static constexpr auto kMusicTypeTags = lcf::makeEnumTags( - "parent", - "event", - "specific" - ); + static constexpr auto kMusicTypeTags = lcf::EnumTags{ + MusicType_parent, "parent", + MusicType_event, "event", + MusicType_specific, "specific" + }; enum BGMType { BGMType_parent = 0, BGMType_terrain = 1, BGMType_specific = 2 }; - static constexpr auto kBGMTypeTags = lcf::makeEnumTags( - "parent", - "terrain", - "specific" - ); + static constexpr auto kBGMTypeTags = lcf::EnumTags{ + BGMType_parent, "parent", + BGMType_terrain, "terrain", + BGMType_specific, "specific" + }; enum TriState { TriState_parent = 0, TriState_allow = 1, TriState_forbid = 2 }; - static constexpr auto kTriStateTags = lcf::makeEnumTags( - "parent", - "allow", - "forbid" - ); + static constexpr auto kTriStateTags = lcf::EnumTags{ + TriState_parent, "parent", + TriState_allow, "allow", + TriState_forbid, "forbid" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/movecommand.h b/src/generated/lcf/rpg/movecommand.h index f3bed318..4832227d 100644 --- a/src/generated/lcf/rpg/movecommand.h +++ b/src/generated/lcf/rpg/movecommand.h @@ -71,50 +71,50 @@ namespace rpg { increase_transp = 40, decrease_transp = 41 }; - static constexpr auto kCodeTags = lcf::makeEnumTags( - "move_up", - "move_right", - "move_down", - "move_left", - "move_upright", - "move_downright", - "move_downleft", - "move_upleft", - "move_random", - "move_towards_hero", - "move_away_from_hero", - "move_forward", - "face_up", - "face_right", - "face_down", - "face_left", - "turn_90_degree_right", - "turn_90_degree_left", - "turn_180_degree", - "turn_90_degree_random", - "face_random_direction", - "face_hero", - "face_away_from_hero", - "wait", - "begin_jump", - "end_jump", - "lock_facing", - "unlock_facing", - "increase_movement_speed", - "decrease_movement_speed", - "increase_movement_frequence", - "decrease_movement_frequence", - "switch_on", - "switch_off", - "change_graphic", - "play_sound_effect", - "walk_everywhere_on", - "walk_everywhere_off", - "stop_animation", - "start_animation", - "increase_transp", - "decrease_transp" - ); + static constexpr auto kCodeTags = lcf::EnumTags{ + Code::move_up, "move_up", + Code::move_right, "move_right", + Code::move_down, "move_down", + Code::move_left, "move_left", + Code::move_upright, "move_upright", + Code::move_downright, "move_downright", + Code::move_downleft, "move_downleft", + Code::move_upleft, "move_upleft", + Code::move_random, "move_random", + Code::move_towards_hero, "move_towards_hero", + Code::move_away_from_hero, "move_away_from_hero", + Code::move_forward, "move_forward", + Code::face_up, "face_up", + Code::face_right, "face_right", + Code::face_down, "face_down", + Code::face_left, "face_left", + Code::turn_90_degree_right, "turn_90_degree_right", + Code::turn_90_degree_left, "turn_90_degree_left", + Code::turn_180_degree, "turn_180_degree", + Code::turn_90_degree_random, "turn_90_degree_random", + Code::face_random_direction, "face_random_direction", + Code::face_hero, "face_hero", + Code::face_away_from_hero, "face_away_from_hero", + Code::wait, "wait", + Code::begin_jump, "begin_jump", + Code::end_jump, "end_jump", + Code::lock_facing, "lock_facing", + Code::unlock_facing, "unlock_facing", + Code::increase_movement_speed, "increase_movement_speed", + Code::decrease_movement_speed, "decrease_movement_speed", + Code::increase_movement_frequence, "increase_movement_frequence", + Code::decrease_movement_frequence, "decrease_movement_frequence", + Code::switch_on, "switch_on", + Code::switch_off, "switch_off", + Code::change_graphic, "change_graphic", + Code::play_sound_effect, "play_sound_effect", + Code::walk_everywhere_on, "walk_everywhere_on", + Code::walk_everywhere_off, "walk_everywhere_off", + Code::stop_animation, "stop_animation", + Code::start_animation, "start_animation", + Code::increase_transp, "increase_transp", + Code::decrease_transp, "decrease_transp" + }; int32_t command_id = 0; DBString parameter_string; diff --git a/src/generated/lcf/rpg/saveactor.h b/src/generated/lcf/rpg/saveactor.h index d55e36ae..05d87441 100644 --- a/src/generated/lcf/rpg/saveactor.h +++ b/src/generated/lcf/rpg/saveactor.h @@ -35,10 +35,10 @@ namespace rpg { RowType_front = 0, RowType_back = 1 }; - static constexpr auto kRowTypeTags = lcf::makeEnumTags( - "front", - "back" - ); + static constexpr auto kRowTypeTags = lcf::EnumTags{ + RowType_front, "front", + RowType_back, "back" + }; int ID = 0; std::string name = kEmptyName; diff --git a/src/generated/lcf/rpg/savepartylocation.h b/src/generated/lcf/rpg/savepartylocation.h index 06f8d687..503ce5bc 100644 --- a/src/generated/lcf/rpg/savepartylocation.h +++ b/src/generated/lcf/rpg/savepartylocation.h @@ -40,20 +40,20 @@ namespace rpg { VehicleType_ship = 2, VehicleType_airship = 3 }; - static constexpr auto kVehicleTypeTags = lcf::makeEnumTags( - "none", - "skiff", - "ship", - "airship" - ); + static constexpr auto kVehicleTypeTags = lcf::EnumTags{ + VehicleType_none, "none", + VehicleType_skiff, "skiff", + VehicleType_ship, "ship", + VehicleType_airship, "airship" + }; enum PanState { PanState_fixed = 0, PanState_follow = 1 }; - static constexpr auto kPanStateTags = lcf::makeEnumTags( - "fixed", - "follow" - ); + static constexpr auto kPanStateTags = lcf::EnumTags{ + PanState_fixed, "fixed", + PanState_follow, "follow" + }; bool boarding = false; bool aboard = false; diff --git a/src/generated/lcf/rpg/savepicture.h b/src/generated/lcf/rpg/savepicture.h index e2402e3c..c1b880e2 100644 --- a/src/generated/lcf/rpg/savepicture.h +++ b/src/generated/lcf/rpg/savepicture.h @@ -34,12 +34,12 @@ namespace rpg { Effect_wave = 2, Effect_maniac_fixed_angle = 3 }; - static constexpr auto kEffectTags = lcf::makeEnumTags( - "none", - "rotation", - "wave", - "maniac_fixed_angle" - ); + static constexpr auto kEffectTags = lcf::EnumTags{ + Effect_none, "none", + Effect_rotation, "rotation", + Effect_wave, "wave", + Effect_maniac_fixed_angle, "maniac_fixed_angle" + }; enum MapLayer { MapLayer_none = 0, MapLayer_parallax = 1, @@ -53,19 +53,19 @@ namespace rpg { MapLayer_windows = 9, MapLayer_timers = 10 }; - static constexpr auto kMapLayerTags = lcf::makeEnumTags( - "none", - "parallax", - "tilemap_below", - "events_below", - "events_same_as_player", - "tilemap_above", - "events_above", - "weather", - "animations", - "windows", - "timers" - ); + static constexpr auto kMapLayerTags = lcf::EnumTags{ + MapLayer_none, "none", + MapLayer_parallax, "parallax", + MapLayer_tilemap_below, "tilemap_below", + MapLayer_events_below, "events_below", + MapLayer_events_same_as_player, "events_same_as_player", + MapLayer_tilemap_above, "tilemap_above", + MapLayer_events_above, "events_above", + MapLayer_weather, "weather", + MapLayer_animations, "animations", + MapLayer_windows, "windows", + MapLayer_timers, "timers" + }; enum BattleLayer { BattleLayer_none = 0, BattleLayer_background = 1, @@ -74,34 +74,34 @@ namespace rpg { BattleLayer_windows_and_status = 4, BattleLayer_timers = 5 }; - static constexpr auto kBattleLayerTags = lcf::makeEnumTags( - "none", - "background", - "battlers_and_animations", - "weather", - "windows_and_status", - "timers" - ); + static constexpr auto kBattleLayerTags = lcf::EnumTags{ + BattleLayer_none, "none", + BattleLayer_background, "background", + BattleLayer_battlers_and_animations, "battlers_and_animations", + BattleLayer_weather, "weather", + BattleLayer_windows_and_status, "windows_and_status", + BattleLayer_timers, "timers" + }; enum EasyRpgFlip { EasyRpgFlip_none = 0, EasyRpgFlip_x = 1, EasyRpgFlip_y = 2, EasyRpgFlip_both = 3 }; - static constexpr auto kEasyRpgFlipTags = lcf::makeEnumTags( - "none", - "x", - "y", - "both" - ); + static constexpr auto kEasyRpgFlipTags = lcf::EnumTags{ + EasyRpgFlip_none, "none", + EasyRpgFlip_x, "x", + EasyRpgFlip_y, "y", + EasyRpgFlip_both, "both" + }; enum EasyRpgType { EasyRpgType_default = 0, EasyRpgType_window = 1 }; - static constexpr auto kEasyRpgTypeTags = lcf::makeEnumTags( - "default", - "window" - ); + static constexpr auto kEasyRpgTypeTags = lcf::EnumTags{ + EasyRpgType_default, "default", + EasyRpgType_window, "window" + }; int ID = 0; std::string name; diff --git a/src/generated/lcf/rpg/savesystem.h b/src/generated/lcf/rpg/savesystem.h index 22575b4e..70d28ddb 100644 --- a/src/generated/lcf/rpg/savesystem.h +++ b/src/generated/lcf/rpg/savesystem.h @@ -42,25 +42,25 @@ namespace rpg { Scene_game_over = 7, Scene_debug = 8 }; - static constexpr auto kSceneTags = lcf::makeEnumTags( - "map", - "menu", - "battle", - "shop", - "name", - "file", - "title", - "game_over", - "debug" - ); + static constexpr auto kSceneTags = lcf::EnumTags{ + Scene_map, "map", + Scene_menu, "menu", + Scene_battle, "battle", + Scene_shop, "shop", + Scene_name, "name", + Scene_file, "file", + Scene_title, "title", + Scene_game_over, "game_over", + Scene_debug, "debug" + }; enum AtbMode { AtbMode_atb_active = 0, AtbMode_atb_wait = 1 }; - static constexpr auto kAtbModeTags = lcf::makeEnumTags( - "atb_active", - "atb_wait" - ); + static constexpr auto kAtbModeTags = lcf::EnumTags{ + AtbMode_atb_active, "atb_active", + AtbMode_atb_wait, "atb_wait" + }; int32_t scene = 0; int32_t frame_count = 0; diff --git a/src/generated/lcf/rpg/savevehiclelocation.h b/src/generated/lcf/rpg/savevehiclelocation.h index daa706a4..e493589a 100644 --- a/src/generated/lcf/rpg/savevehiclelocation.h +++ b/src/generated/lcf/rpg/savevehiclelocation.h @@ -34,12 +34,12 @@ namespace rpg { VehicleType_ship = 2, VehicleType_airship = 3 }; - static constexpr auto kVehicleTypeTags = lcf::makeEnumTags( - "none", - "skiff", - "ship", - "airship" - ); + static constexpr auto kVehicleTypeTags = lcf::EnumTags{ + VehicleType_none, "none", + VehicleType_skiff, "skiff", + VehicleType_ship, "ship", + VehicleType_airship, "airship" + }; int32_t vehicle = 0; int32_t remaining_ascent = 0; diff --git a/src/generated/lcf/rpg/skill.h b/src/generated/lcf/rpg/skill.h index f659b4c7..9194aa28 100644 --- a/src/generated/lcf/rpg/skill.h +++ b/src/generated/lcf/rpg/skill.h @@ -41,21 +41,21 @@ namespace rpg { Type_switch = 3, Type_subskill = 4 }; - static constexpr auto kTypeTags = lcf::makeEnumTags( - "normal", - "teleport", - "escape", - "switch", - "subskill" - ); + static constexpr auto kTypeTags = lcf::EnumTags{ + Type_normal, "normal", + Type_teleport, "teleport", + Type_escape, "escape", + Type_switch, "switch", + Type_subskill, "subskill" + }; enum SpType { SpType_cost = 0, SpType_percent = 1 }; - static constexpr auto kSpTypeTags = lcf::makeEnumTags( - "cost", - "percent" - ); + static constexpr auto kSpTypeTags = lcf::EnumTags{ + SpType_cost, "cost", + SpType_percent, "percent" + }; enum Scope { Scope_enemy = 0, Scope_enemies = 1, @@ -63,21 +63,21 @@ namespace rpg { Scope_ally = 3, Scope_party = 4 }; - static constexpr auto kScopeTags = lcf::makeEnumTags( - "enemy", - "enemies", - "self", - "ally", - "party" - ); + static constexpr auto kScopeTags = lcf::EnumTags{ + Scope_enemy, "enemy", + Scope_enemies, "enemies", + Scope_self, "self", + Scope_ally, "ally", + Scope_party, "party" + }; enum HpType { HpType_cost = 0, HpType_percent = 1 }; - static constexpr auto kHpTypeTags = lcf::makeEnumTags( - "cost", - "percent" - ); + static constexpr auto kHpTypeTags = lcf::EnumTags{ + HpType_cost, "cost", + HpType_percent, "percent" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/state.h b/src/generated/lcf/rpg/state.h index b962054b..84574a1e 100644 --- a/src/generated/lcf/rpg/state.h +++ b/src/generated/lcf/rpg/state.h @@ -35,42 +35,42 @@ namespace rpg { Persistence_ends = 0, Persistence_persists = 1 }; - static constexpr auto kPersistenceTags = lcf::makeEnumTags( - "ends", - "persists" - ); + static constexpr auto kPersistenceTags = lcf::EnumTags{ + Persistence_ends, "ends", + Persistence_persists, "persists" + }; enum Restriction { Restriction_normal = 0, Restriction_do_nothing = 1, Restriction_attack_enemy = 2, Restriction_attack_ally = 3 }; - static constexpr auto kRestrictionTags = lcf::makeEnumTags( - "normal", - "do_nothing", - "attack_enemy", - "attack_ally" - ); + static constexpr auto kRestrictionTags = lcf::EnumTags{ + Restriction_normal, "normal", + Restriction_do_nothing, "do_nothing", + Restriction_attack_enemy, "attack_enemy", + Restriction_attack_ally, "attack_ally" + }; enum AffectType { AffectType_half = 0, AffectType_double = 1, AffectType_nothing = 2 }; - static constexpr auto kAffectTypeTags = lcf::makeEnumTags( - "half", - "double", - "nothing" - ); + static constexpr auto kAffectTypeTags = lcf::EnumTags{ + AffectType_half, "half", + AffectType_double, "double", + AffectType_nothing, "nothing" + }; enum ChangeType { ChangeType_lose = 0, ChangeType_gain = 1, ChangeType_nothing = 2 }; - static constexpr auto kChangeTypeTags = lcf::makeEnumTags( - "lose", - "gain", - "nothing" - ); + static constexpr auto kChangeTypeTags = lcf::EnumTags{ + ChangeType_lose, "lose", + ChangeType_gain, "gain", + ChangeType_nothing, "nothing" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/system.h b/src/generated/lcf/rpg/system.h index eb9c625a..e05ecaed 100644 --- a/src/generated/lcf/rpg/system.h +++ b/src/generated/lcf/rpg/system.h @@ -55,30 +55,30 @@ namespace rpg { FadeOut_instantaneous = 20, FadeOut_none = 21 }; - static constexpr auto kFadeOutTags = lcf::makeEnumTags( - "default", - "fade_out", - "remove_blocks", - "wipe_downward", - "wipe_upward", - "venetian_blinds", - "vertical_blinds", - "horizontal_blinds", - "receding_square", - "expanding_square", - "screen_moves_up", - "screen_moves_down", - "screen_moves_left", - "screen_moves_right", - "vertical_div", - "horizontal_div", - "quadrasection", - "zoom_in", - "mosaic", - "waver_screen", - "instantaneous", - "none" - ); + static constexpr auto kFadeOutTags = lcf::EnumTags{ + FadeOut_default, "default", + FadeOut_fade_out, "fade_out", + FadeOut_remove_blocks, "remove_blocks", + FadeOut_wipe_downward, "wipe_downward", + FadeOut_wipe_upward, "wipe_upward", + FadeOut_venetian_blinds, "venetian_blinds", + FadeOut_vertical_blinds, "vertical_blinds", + FadeOut_horizontal_blinds, "horizontal_blinds", + FadeOut_receding_square, "receding_square", + FadeOut_expanding_square, "expanding_square", + FadeOut_screen_moves_up, "screen_moves_up", + FadeOut_screen_moves_down, "screen_moves_down", + FadeOut_screen_moves_left, "screen_moves_left", + FadeOut_screen_moves_right, "screen_moves_right", + FadeOut_vertical_div, "vertical_div", + FadeOut_horizontal_div, "horizontal_div", + FadeOut_quadrasection, "quadrasection", + FadeOut_zoom_in, "zoom_in", + FadeOut_mosaic, "mosaic", + FadeOut_waver_screen, "waver_screen", + FadeOut_instantaneous, "instantaneous", + FadeOut_none, "none" + }; enum FadeIn { FadeIn_default = 0, FadeIn_fade_in = 1, @@ -103,58 +103,58 @@ namespace rpg { FadeIn_instantaneous = 20, FadeIn_none = 21 }; - static constexpr auto kFadeInTags = lcf::makeEnumTags( - "default", - "fade_in", - "reconstitute_blocks", - "unwipe_downward", - "unwipe_upward", - "venetian_blinds", - "vertical_blinds", - "horizontal_blinds", - "receding_square", - "expanding_square", - "screen_moves_down", - "screen_moves_up", - "screen_moves_right", - "screen_moves_left", - "vertical_unify", - "horizontal_unify", - "unify_quadrants", - "zoom_out", - "mosaic", - "waver_screen", - "instantaneous", - "none" - ); + static constexpr auto kFadeInTags = lcf::EnumTags{ + FadeIn_default, "default", + FadeIn_fade_in, "fade_in", + FadeIn_reconstitute_blocks, "reconstitute_blocks", + FadeIn_unwipe_downward, "unwipe_downward", + FadeIn_unwipe_upward, "unwipe_upward", + FadeIn_venetian_blinds, "venetian_blinds", + FadeIn_vertical_blinds, "vertical_blinds", + FadeIn_horizontal_blinds, "horizontal_blinds", + FadeIn_receding_square, "receding_square", + FadeIn_expanding_square, "expanding_square", + FadeIn_screen_moves_down, "screen_moves_down", + FadeIn_screen_moves_up, "screen_moves_up", + FadeIn_screen_moves_right, "screen_moves_right", + FadeIn_screen_moves_left, "screen_moves_left", + FadeIn_vertical_unify, "vertical_unify", + FadeIn_horizontal_unify, "horizontal_unify", + FadeIn_unify_quadrants, "unify_quadrants", + FadeIn_zoom_out, "zoom_out", + FadeIn_mosaic, "mosaic", + FadeIn_waver_screen, "waver_screen", + FadeIn_instantaneous, "instantaneous", + FadeIn_none, "none" + }; enum Stretch { Stretch_stretch = 0, Stretch_tiled = 1, Stretch_easyrpg_none = 2 }; - static constexpr auto kStretchTags = lcf::makeEnumTags( - "stretch", - "tiled", - "easyrpg_none" - ); + static constexpr auto kStretchTags = lcf::EnumTags{ + Stretch_stretch, "stretch", + Stretch_tiled, "tiled", + Stretch_easyrpg_none, "easyrpg_none" + }; enum Font { Font_gothic = 0, Font_mincho = 1 }; - static constexpr auto kFontTags = lcf::makeEnumTags( - "gothic", - "mincho" - ); + static constexpr auto kFontTags = lcf::EnumTags{ + Font_gothic, "gothic", + Font_mincho, "mincho" + }; enum BattleFormation { BattleFormation_terrain = 0, BattleFormation_loose = 1, BattleFormation_tight = 2 }; - static constexpr auto kBattleFormationTags = lcf::makeEnumTags( - "terrain", - "loose", - "tight" - ); + static constexpr auto kBattleFormationTags = lcf::EnumTags{ + BattleFormation_terrain, "terrain", + BattleFormation_loose, "loose", + BattleFormation_tight, "tight" + }; enum BattleCondition { BattleCondition_none = 0, BattleCondition_initiative = 1, @@ -162,21 +162,21 @@ namespace rpg { BattleCondition_surround = 3, BattleCondition_pincers = 4 }; - static constexpr auto kBattleConditionTags = lcf::makeEnumTags( - "none", - "initiative", - "back", - "surround", - "pincers" - ); + static constexpr auto kBattleConditionTags = lcf::EnumTags{ + BattleCondition_none, "none", + BattleCondition_initiative, "initiative", + BattleCondition_back, "back", + BattleCondition_surround, "surround", + BattleCondition_pincers, "pincers" + }; enum EquipmentSetting { EquipmentSetting_actor = 0, EquipmentSetting_class = 1 }; - static constexpr auto kEquipmentSettingTags = lcf::makeEnumTags( - "actor", - "class" - ); + static constexpr auto kEquipmentSettingTags = lcf::EnumTags{ + EquipmentSetting_actor, "actor", + EquipmentSetting_class, "class" + }; int32_t ldb_id = 0; DBString boat_name; diff --git a/src/generated/lcf/rpg/terrain.h b/src/generated/lcf/rpg/terrain.h index 5aec88af..b41e5c03 100644 --- a/src/generated/lcf/rpg/terrain.h +++ b/src/generated/lcf/rpg/terrain.h @@ -35,20 +35,20 @@ namespace rpg { BushDepth_half = 2, BushDepth_full = 3 }; - static constexpr auto kBushDepthTags = lcf::makeEnumTags( - "normal", - "third", - "half", - "full" - ); + static constexpr auto kBushDepthTags = lcf::EnumTags{ + BushDepth_normal, "normal", + BushDepth_third, "third", + BushDepth_half, "half", + BushDepth_full, "full" + }; enum BGAssociation { BGAssociation_background = 0, BGAssociation_frame = 1 }; - static constexpr auto kBGAssociationTags = lcf::makeEnumTags( - "background", - "frame" - ); + static constexpr auto kBGAssociationTags = lcf::EnumTags{ + BGAssociation_background, "background", + BGAssociation_frame, "frame" + }; int ID = 0; DBString name; diff --git a/src/generated/lcf/rpg/treemap.h b/src/generated/lcf/rpg/treemap.h index f9b0c3de..eeb5527b 100644 --- a/src/generated/lcf/rpg/treemap.h +++ b/src/generated/lcf/rpg/treemap.h @@ -34,11 +34,11 @@ namespace rpg { MapType_map = 1, MapType_area = 2 }; - static constexpr auto kMapTypeTags = lcf::makeEnumTags( - "root", - "map", - "area" - ); + static constexpr auto kMapTypeTags = lcf::EnumTags{ + MapType_root, "root", + MapType_map, "map", + MapType_area, "area" + }; std::vector maps; std::vector tree_order; diff --git a/src/lcf/enum_tags.h b/src/lcf/enum_tags.h index 2e6f9aa5..4056a1a1 100644 --- a/src/lcf/enum_tags.h +++ b/src/lcf/enum_tags.h @@ -22,24 +22,45 @@ template class EnumTags { public: static constexpr size_t num_tags = N; - using int_type = typename std::make_unsigned::type>::type; - using iterator = char const * const *; + using int_type = typename std::underlying_type::type; + + struct EnumItem { + int_type value; + const char* name; + + constexpr EnumItem() noexcept : value(), name() {} + constexpr EnumItem(int_type value, const char* name) noexcept : value(value), name(name) {} + }; + + using iterator = EnumItem const *; using reverse_iterator = std::reverse_iterator; - template - explicit constexpr EnumTags(const char (&...literals)[LN]) : _tags{{literals...}} {} + template + explicit constexpr EnumTags(Args const&...args) noexcept { + AddTag<0>(args...); + + int_type i = 0; + for (const auto& it : _tags) { + if (it.value != i) { + monotonic_from_zero = false; + } + ++i; + } + } - constexpr const char* tag(E etag) const { return tag(int_type(etag)); } - constexpr const char* tag(int_type idx) const { return _tags[idx]; } + constexpr const char* tag(int_type value) const; + constexpr const char* tag(E etag) const; - constexpr const char* operator[](E etag) const { return tag(etag); } - constexpr const char* operator[](int_type idx) const { return tag(idx); } + constexpr const char* operator[](E etag) const; + constexpr const char* operator[](int_type value) const; + bool has_etag(const char* tag) const; bool etag(const char* tag, E& result) const; E etagOr(const char* tag, E other) const; - int_type idx(const char* tag) const; - const std::array& tags() const { return _tags; } + const std::array& tags() const { return _tags; } + + constexpr bool is_monotonic_from_zero() const { return monotonic_from_zero; } constexpr iterator begin() const { return iterator(_tags.data()); } constexpr iterator end() const { return iterator(_tags.data() + size()); } @@ -53,38 +74,88 @@ class EnumTags { static constexpr size_t size() { return num_tags; } private: - const std::array _tags; + template + constexpr void AddTag(E value, const char* name, Next const&...next) noexcept { + _tags[I] = {int_type(value), name}; + + if constexpr (sizeof...(Next) > 0) { + AddTag(next...); + } + } + + std::array _tags; + bool monotonic_from_zero = true; }; -template -constexpr EnumTags makeEnumTags(const char (&...literals)[N]) { - return EnumTags(literals...); +template +EnumTags(ValueType const&, const char*, Next const&...) -> EnumTags; + +template +inline constexpr const char* EnumTags::tag(E etag) const { + return tag(int_type(etag)); } template -inline typename EnumTags::int_type EnumTags::idx(const char* tag) const { +inline constexpr const char* EnumTags::tag(int_type value) const { + if (monotonic_from_zero) { + if (value < 0 || value >= N) { + return nullptr; + } else { + return _tags[value].name; + } + } + + for (const auto& it: _tags) { + if (it.value == value) { + return it.name; + } + } + + return nullptr; +} + +template +inline constexpr const char* EnumTags::operator[](E etag) const { + return tag(etag); +} + +template +inline constexpr const char* EnumTags::operator[](int_type value) const { + return tag(value); +} + +template +inline bool EnumTags::has_etag(const char* tag) const { for (size_t i = 0; i < _tags.size(); ++i) { - if (std::strcmp(_tags[i], tag) == 0) { - return i; + if (std::strcmp(_tags[i].name, tag) == 0) { + return true; } } - return -1; + + return false; } template inline bool EnumTags::etag(const char* tag, E& result) const { - auto i = idx(tag); - if (i < 0) { - return false; + for (size_t i = 0; i < _tags.size(); ++i) { + if (std::strcmp(_tags[i].name, tag) == 0) { + result = E(_tags[i].value); + return true; + } } - result = E(i); - return true; + + return false; } template inline E EnumTags::etagOr(const char* tag, E other) const { - auto i = idx(tag); - return (i >= 0) ? E(i) : other; + for (size_t i = 0; i < _tags.size(); ++i) { + if (std::strcmp(_tags[i].name, tag) == 0) { + return E(_tags[i].value); + } + } + + return other; } } //namespace lcf diff --git a/tests/enum_tags.cpp b/tests/enum_tags.cpp new file mode 100644 index 00000000..2afec356 --- /dev/null +++ b/tests/enum_tags.cpp @@ -0,0 +1,457 @@ +/* + * This file is part of liblcf. Copyright (c) liblcf authors. + * https://github.com/EasyRPG/liblcf - https://easyrpg.org + * + * liblcf is Free/Libre Open Source Software, released under the MIT License. + * For the full copyright and license information, please view the COPYING + * file that was distributed with this source code. + */ + +#include "lcf/enum_tags.h" +#include "doctest.h" +#include + +using namespace lcf; + +enum Color { + Color_Red, + Color_Green, + Color_Blue, + Color_Yellow +}; + +static constexpr auto kColorTags = lcf::EnumTags{ + Color_Red, "Red", + Color_Green, "Green", + Color_Blue, "Blue", + Color_Yellow, "Yellow" +}; + +enum class Name { + Aina = 2, + Brian = 4, + Carol = -1, +}; + +static constexpr auto kNameTags = lcf::EnumTags{ + Name::Aina, "Aina", + Name::Brian, "Brian", + Name::Carol, "Carol" +}; + +TEST_SUITE_BEGIN("enum_tags"); + +TEST_CASE("size") { + REQUIRE_EQ(kColorTags.size(), 4); + REQUIRE_EQ(kNameTags.size(), 3); +} + +TEST_CASE("monotonic from zero") { + REQUIRE(kColorTags.is_monotonic_from_zero()); + REQUIRE(!kNameTags.is_monotonic_from_zero()); +} + +TEST_CASE("tag int") { + REQUIRE_EQ(kColorTags.tag(0), "Red"); + REQUIRE_EQ(kColorTags.tag(3), "Yellow"); + + REQUIRE_EQ(kColorTags.tag(4), nullptr); + + REQUIRE_EQ(kNameTags.tag(2), "Aina"); + REQUIRE_EQ(kNameTags.tag(4), "Brian"); + REQUIRE_EQ(kNameTags.tag(-1), "Carol"); + + REQUIRE_EQ(kNameTags.tag(0), nullptr); + REQUIRE_EQ(kNameTags.tag(-3), nullptr); + + REQUIRE_EQ(kColorTags[0], "Red"); + REQUIRE_EQ(kColorTags[4], nullptr); + + REQUIRE_EQ(kNameTags[2], "Aina"); + REQUIRE_EQ(kNameTags[-1], "Carol"); + REQUIRE_EQ(kNameTags[0], nullptr); +} + +TEST_CASE("tag enum") { + REQUIRE_EQ(kColorTags.tag(Color_Red), "Red"); + REQUIRE_EQ(kColorTags.tag(Color_Yellow), "Yellow"); + + REQUIRE_EQ(kNameTags.tag(Name::Aina), "Aina"); + REQUIRE_EQ(kNameTags.tag(Name::Brian), "Brian"); + + REQUIRE_EQ(kColorTags[Color_Red], "Red"); + REQUIRE_EQ(kColorTags[Color_Yellow], "Yellow"); + + REQUIRE_EQ(kNameTags[Name::Aina], "Aina"); + REQUIRE_EQ(kNameTags[Name::Brian], "Brian"); +} + +TEST_CASE("etag") { + Color result; + + REQUIRE(kColorTags.etag("Blue", result)); + REQUIRE_EQ(result, Color_Blue); + + REQUIRE(!kColorTags.etag("NotInEnum", result)); + + Name nresult; + + REQUIRE(kNameTags.etag("Carol", nresult)); + REQUIRE_EQ(nresult, Name::Carol); + + REQUIRE(!kNameTags.etag("NotInEnum", nresult)); +} + +TEST_CASE("etagOr") { + REQUIRE_EQ(kColorTags.etagOr("Blue", Color_Yellow), Color_Blue); + REQUIRE_EQ(kColorTags.etagOr("NotInEnum", Color_Yellow), Color_Yellow); +} + +TEST_CASE("has_etag") { + REQUIRE(kColorTags.has_etag("Blue")); + REQUIRE(!kColorTags.has_etag("NotInEnum")); + + REQUIRE(kNameTags.has_etag("Aina")); + REQUIRE(kNameTags.has_etag("Carol")); + REQUIRE(!kNameTags.has_etag("NotInEnum")); +} + +TEST_CASE("iterator") { + for (auto it = kNameTags.begin(); it != kNameTags.end(); ++it) { + REQUIRE(kNameTags.has_etag(it->name)); + } + + for (auto it = kNameTags.cbegin(); it != kNameTags.cend(); ++it) { + REQUIRE(kNameTags.has_etag(it->name)); + } + + for (auto it = kNameTags.rbegin(); it != kNameTags.rend(); ++it) { + REQUIRE(kNameTags.has_etag(it->name)); + } +} + +// API Test for the Key Enum in Player. Exceeds int8_t +enum Overflow : uint8_t { + Val_0, + Val_1, + Val_2, + Val_3, + Val_4, + Val_5, + Val_6, + Val_7, + Val_8, + Val_9, + Val_10, + Val_11, + Val_12, + Val_13, + Val_14, + Val_15, + Val_16, + Val_17, + Val_18, + Val_19, + Val_20, + Val_21, + Val_22, + Val_23, + Val_24, + Val_25, + Val_26, + Val_27, + Val_28, + Val_29, + Val_30, + Val_31, + Val_32, + Val_33, + Val_34, + Val_35, + Val_36, + Val_37, + Val_38, + Val_39, + Val_40, + Val_41, + Val_42, + Val_43, + Val_44, + Val_45, + Val_46, + Val_47, + Val_48, + Val_49, + Val_50, + Val_51, + Val_52, + Val_53, + Val_54, + Val_55, + Val_56, + Val_57, + Val_58, + Val_59, + Val_60, + Val_61, + Val_62, + Val_63, + Val_64, + Val_65, + Val_66, + Val_67, + Val_68, + Val_69, + Val_70, + Val_71, + Val_72, + Val_73, + Val_74, + Val_75, + Val_76, + Val_77, + Val_78, + Val_79, + Val_80, + Val_81, + Val_82, + Val_83, + Val_84, + Val_85, + Val_86, + Val_87, + Val_88, + Val_89, + Val_90, + Val_91, + Val_92, + Val_93, + Val_94, + Val_95, + Val_96, + Val_97, + Val_98, + Val_99, + Val_100, + Val_101, + Val_102, + Val_103, + Val_104, + Val_105, + Val_106, + Val_107, + Val_108, + Val_109, + Val_110, + Val_111, + Val_112, + Val_113, + Val_114, + Val_115, + Val_116, + Val_117, + Val_118, + Val_119, + Val_120, + Val_121, + Val_122, + Val_123, + Val_124, + Val_125, + Val_126, + Val_127, + Val_128, + Val_129, + Val_130, + Val_131, + Val_132, + Val_133, + Val_134, + Val_135, + Val_136, + Val_137, + Val_138, + Val_139, + Val_140, + Val_141, + Val_142, + Val_143, + Val_144, + Val_145, + Val_146, + Val_147, + Val_148, + Val_149 +}; + +static constexpr auto kOverflowTags = lcf::EnumTags{ + Val_0, "Val_0", + Val_1, "Val_1", + Val_2, "Val_2", + Val_3, "Val_3", + Val_4, "Val_4", + Val_5, "Val_5", + Val_6, "Val_6", + Val_7, "Val_7", + Val_8, "Val_8", + Val_9, "Val_9", + Val_10, "Val_10", + Val_11, "Val_11", + Val_12, "Val_12", + Val_13, "Val_13", + Val_14, "Val_14", + Val_15, "Val_15", + Val_16, "Val_16", + Val_17, "Val_17", + Val_18, "Val_18", + Val_19, "Val_19", + Val_20, "Val_20", + Val_21, "Val_21", + Val_22, "Val_22", + Val_23, "Val_23", + Val_24, "Val_24", + Val_25, "Val_25", + Val_26, "Val_26", + Val_27, "Val_27", + Val_28, "Val_28", + Val_29, "Val_29", + Val_30, "Val_30", + Val_31, "Val_31", + Val_32, "Val_32", + Val_33, "Val_33", + Val_34, "Val_34", + Val_35, "Val_35", + Val_36, "Val_36", + Val_37, "Val_37", + Val_38, "Val_38", + Val_39, "Val_39", + Val_40, "Val_40", + Val_41, "Val_41", + Val_42, "Val_42", + Val_43, "Val_43", + Val_44, "Val_44", + Val_45, "Val_45", + Val_46, "Val_46", + Val_47, "Val_47", + Val_48, "Val_48", + Val_49, "Val_49", + Val_50, "Val_50", + Val_51, "Val_51", + Val_52, "Val_52", + Val_53, "Val_53", + Val_54, "Val_54", + Val_55, "Val_55", + Val_56, "Val_56", + Val_57, "Val_57", + Val_58, "Val_58", + Val_59, "Val_59", + Val_60, "Val_60", + Val_61, "Val_61", + Val_62, "Val_62", + Val_63, "Val_63", + Val_64, "Val_64", + Val_65, "Val_65", + Val_66, "Val_66", + Val_67, "Val_67", + Val_68, "Val_68", + Val_69, "Val_69", + Val_70, "Val_70", + Val_71, "Val_71", + Val_72, "Val_72", + Val_73, "Val_73", + Val_74, "Val_74", + Val_75, "Val_75", + Val_76, "Val_76", + Val_77, "Val_77", + Val_78, "Val_78", + Val_79, "Val_79", + Val_80, "Val_80", + Val_81, "Val_81", + Val_82, "Val_82", + Val_83, "Val_83", + Val_84, "Val_84", + Val_85, "Val_85", + Val_86, "Val_86", + Val_87, "Val_87", + Val_88, "Val_88", + Val_89, "Val_89", + Val_90, "Val_90", + Val_91, "Val_91", + Val_92, "Val_92", + Val_93, "Val_93", + Val_94, "Val_94", + Val_95, "Val_95", + Val_96, "Val_96", + Val_97, "Val_97", + Val_98, "Val_98", + Val_99, "Val_99", + Val_100, "Val_100", + Val_101, "Val_101", + Val_102, "Val_102", + Val_103, "Val_103", + Val_104, "Val_104", + Val_105, "Val_105", + Val_106, "Val_106", + Val_107, "Val_107", + Val_108, "Val_108", + Val_109, "Val_109", + Val_110, "Val_110", + Val_111, "Val_111", + Val_112, "Val_112", + Val_113, "Val_113", + Val_114, "Val_114", + Val_115, "Val_115", + Val_116, "Val_116", + Val_117, "Val_117", + Val_118, "Val_118", + Val_119, "Val_119", + Val_120, "Val_120", + Val_121, "Val_121", + Val_122, "Val_122", + Val_123, "Val_123", + Val_124, "Val_124", + Val_125, "Val_125", + Val_126, "Val_126", + Val_127, "Val_127", + Val_128, "Val_128", + Val_129, "Val_129", + Val_130, "Val_130", + Val_131, "Val_131", + Val_132, "Val_132", + Val_133, "Val_133", + Val_134, "Val_134", + Val_135, "Val_135", + Val_136, "Val_136", + Val_137, "Val_137", + Val_138, "Val_138", + Val_139, "Val_139", + Val_140, "Val_140", + Val_141, "Val_141", + Val_142, "Val_142", + Val_143, "Val_143", + Val_144, "Val_144", + Val_145, "Val_145", + Val_146, "Val_146", + Val_147, "Val_147", + Val_148, "Val_148", + Val_149, "Val_149" +}; + +TEST_CASE("8 Bit overflow") { + Overflow o; + + REQUIRE_EQ(kOverflowTags.size(), 150); + + REQUIRE(kOverflowTags.is_monotonic_from_zero()); + + REQUIRE(kOverflowTags.has_etag("Val_110")); + REQUIRE(kOverflowTags.has_etag("Val_149")); + + REQUIRE_EQ(kOverflowTags.tag(149), "Val_149"); + REQUIRE_EQ(kOverflowTags.tag(Val_149), "Val_149"); + + REQUIRE(kOverflowTags.etag("Val_149", o)); + REQUIRE_EQ(Val_149, o); +} + +TEST_SUITE_END();