1 /* !!!! GENERATED FILE - DO NOT EDIT !!!! 2 * -------------------------------------- 3 * 4 * This file is part of liblcf. Copyright (c) 2021 liblcf authors. 5 * https://github.com/EasyRPG/liblcf - https://easyrpg.org 6 * 7 * liblcf is Free/Libre Open Source Software, released under the MIT License. 8 * For the full copyright and license information, please view the COPYING 9 * file that was distributed with this source code. 10 */ 11 12 #ifndef LCF_RPG_BATTLECOMMANDS_H 13 #define LCF_RPG_BATTLECOMMANDS_H 14 15 // Headers 16 #include <stdint.h> 17 #include <vector> 18 #include "lcf/enum_tags.h" 19 #include "lcf/rpg/battlecommand.h" 20 #include "lcf/context.h" 21 #include <ostream> 22 #include <type_traits> 23 24 /** 25 * rpg::BattleCommands class. 26 */ 27 namespace lcf { 28 namespace rpg { 29 class BattleCommands { 30 public: 31 enum Placement { 32 Placement_manual = 0, 33 Placement_automatic = 1 34 }; 35 static constexpr auto kPlacementTags = lcf::makeEnumTags<Placement>( 36 "manual", 37 "automatic" 38 ); 39 enum RowShown { 40 RowShown_front = 0, 41 RowShown_back = 1 42 }; 43 static constexpr auto kRowShownTags = lcf::makeEnumTags<RowShown>( 44 "front", 45 "back" 46 ); 47 enum BattleType { 48 BattleType_traditional = 0, 49 BattleType_alternative = 1, 50 BattleType_gauge = 2 51 }; 52 static constexpr auto kBattleTypeTags = lcf::makeEnumTags<BattleType>( 53 "traditional", 54 "alternative", 55 "gauge" 56 ); 57 enum WindowSize { 58 WindowSize_large = 0, 59 WindowSize_small = 1 60 }; 61 static constexpr auto kWindowSizeTags = lcf::makeEnumTags<WindowSize>( 62 "large", 63 "small" 64 ); 65 enum Transparency { 66 Transparency_opaque = 0, 67 Transparency_transparent = 1 68 }; 69 static constexpr auto kTransparencyTags = lcf::makeEnumTags<Transparency>( 70 "opaque", 71 "transparent" 72 ); 73 enum Facing { 74 Facing_retain = 0, 75 Facing_up = 1, 76 Facing_right = 2, 77 Facing_down = 3, 78 Facing_left = 4 79 }; 80 static constexpr auto kFacingTags = lcf::makeEnumTags<Facing>( 81 "retain", 82 "up", 83 "right", 84 "down", 85 "left" 86 ); 87 88 int32_t placement = 0; 89 bool death_handler_unused = 0; 90 int32_t row = 0; 91 int32_t battle_type = 0; 92 bool unused_display_normal_parameters = true; 93 std::vector<BattleCommand> commands; 94 bool death_handler = 0; 95 int32_t death_event = 1; 96 int32_t window_size = 0; 97 int32_t transparency = 0; 98 bool death_teleport = false; 99 int32_t death_teleport_id = 1; 100 int32_t death_teleport_x = 0; 101 int32_t death_teleport_y = 0; 102 int32_t death_teleport_face = 0; 103 int32_t easyrpg_default_atb_mode = 0; 104 bool easyrpg_enable_battle_row_command = true; 105 bool easyrpg_sequential_order = false; 106 }; 107 inline std::ostream& operator<<(std::ostream& os, BattleCommands::Placement code) { 108 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 109 return os; 110 } 111 inline std::ostream& operator<<(std::ostream& os, BattleCommands::RowShown code) { 112 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 113 return os; 114 } 115 inline std::ostream& operator<<(std::ostream& os, BattleCommands::BattleType code) { 116 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 117 return os; 118 } 119 inline std::ostream& operator<<(std::ostream& os, BattleCommands::WindowSize code) { 120 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 121 return os; 122 } 123 inline std::ostream& operator<<(std::ostream& os, BattleCommands::Transparency code) { 124 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 125 return os; 126 } 127 inline std::ostream& operator<<(std::ostream& os, BattleCommands::Facing code) { 128 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 129 return os; 130 } 131 132 inline bool operator==(const BattleCommands& l, const BattleCommands& r) { 133 return l.placement == r.placement 134 && l.death_handler_unused == r.death_handler_unused 135 && l.row == r.row 136 && l.battle_type == r.battle_type 137 && l.unused_display_normal_parameters == r.unused_display_normal_parameters 138 && l.commands == r.commands 139 && l.death_handler == r.death_handler 140 && l.death_event == r.death_event 141 && l.window_size == r.window_size 142 && l.transparency == r.transparency 143 && l.death_teleport == r.death_teleport 144 && l.death_teleport_id == r.death_teleport_id 145 && l.death_teleport_x == r.death_teleport_x 146 && l.death_teleport_y == r.death_teleport_y 147 && l.death_teleport_face == r.death_teleport_face 148 && l.easyrpg_default_atb_mode == r.easyrpg_default_atb_mode 149 && l.easyrpg_enable_battle_row_command == r.easyrpg_enable_battle_row_command 150 && l.easyrpg_sequential_order == r.easyrpg_sequential_order; 151 } 152 153 inline bool operator!=(const BattleCommands& l, const BattleCommands& r) { 154 return !(l == r); 155 } 156 157 std::ostream& operator<<(std::ostream& os, const BattleCommands& obj); 158 159 template <typename F, typename ParentCtx = Context<void,void>> 160 void ForEachString(BattleCommands& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 161 for (int i = 0; i < static_cast<int>(obj.commands.size()); ++i) { 162 const auto ctx6 = Context<BattleCommands, ParentCtx>{ "commands", i, &obj, parent_ctx }; 163 ForEachString(obj.commands[i], f, &ctx6); 164 } 165 (void)obj; 166 (void)f; 167 (void)parent_ctx; 168 } 169 170 } // namespace rpg 171 } // namespace lcf 172 173 #endif 174