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_TROOPPAGECONDITION_H 13 #define LCF_RPG_TROOPPAGECONDITION_H 14 15 // Headers 16 #include <array> 17 #include <stdint.h> 18 #include "lcf/context.h" 19 #include <ostream> 20 #include <type_traits> 21 22 /** 23 * rpg::TroopPageCondition class. 24 */ 25 namespace lcf { 26 namespace rpg { 27 class TroopPageCondition { 28 public: 29 struct Flags { 30 union { 31 struct { 32 bool switch_a; 33 bool switch_b; 34 bool variable; 35 bool turn; 36 bool fatigue; 37 bool enemy_hp; 38 bool actor_hp; 39 bool turn_enemy; 40 bool turn_actor; 41 bool command_actor; 42 }; 43 std::array<bool, 10> flags; 44 }; 45 //TODO: Should try to switch to member initializers when we upgrade to VS2017. FlagsFlags46 Flags() noexcept: switch_a(false), switch_b(false), variable(false), turn(false), fatigue(false), enemy_hp(false), actor_hp(false), turn_enemy(false), turn_actor(false), command_actor(false) 47 {} 48 } flags; 49 int32_t switch_a_id = 1; 50 int32_t switch_b_id = 1; 51 int32_t variable_id = 1; 52 int32_t variable_value = 0; 53 int32_t turn_a = 0; 54 int32_t turn_b = 0; 55 int32_t fatigue_min = 0; 56 int32_t fatigue_max = 100; 57 int32_t enemy_id = 0; 58 int32_t enemy_hp_min = 0; 59 int32_t enemy_hp_max = 100; 60 int32_t actor_id = 1; 61 int32_t actor_hp_min = 0; 62 int32_t actor_hp_max = 100; 63 int32_t turn_enemy_id = 0; 64 int32_t turn_enemy_a = 0; 65 int32_t turn_enemy_b = 0; 66 int32_t turn_actor_id = 1; 67 int32_t turn_actor_a = 0; 68 int32_t turn_actor_b = 0; 69 int32_t command_actor_id = 1; 70 int32_t command_id = 1; 71 }; 72 73 inline bool operator==(const TroopPageCondition::Flags& l, const TroopPageCondition::Flags& r) { 74 return l.flags == r.flags; 75 } 76 77 inline bool operator!=(const TroopPageCondition::Flags& l, const TroopPageCondition::Flags& r) { 78 return !(l == r); 79 } 80 81 std::ostream& operator<<(std::ostream& os, const TroopPageCondition::Flags& obj); 82 83 inline bool operator==(const TroopPageCondition& l, const TroopPageCondition& r) { 84 return l.flags == r.flags 85 && l.switch_a_id == r.switch_a_id 86 && l.switch_b_id == r.switch_b_id 87 && l.variable_id == r.variable_id 88 && l.variable_value == r.variable_value 89 && l.turn_a == r.turn_a 90 && l.turn_b == r.turn_b 91 && l.fatigue_min == r.fatigue_min 92 && l.fatigue_max == r.fatigue_max 93 && l.enemy_id == r.enemy_id 94 && l.enemy_hp_min == r.enemy_hp_min 95 && l.enemy_hp_max == r.enemy_hp_max 96 && l.actor_id == r.actor_id 97 && l.actor_hp_min == r.actor_hp_min 98 && l.actor_hp_max == r.actor_hp_max 99 && l.turn_enemy_id == r.turn_enemy_id 100 && l.turn_enemy_a == r.turn_enemy_a 101 && l.turn_enemy_b == r.turn_enemy_b 102 && l.turn_actor_id == r.turn_actor_id 103 && l.turn_actor_a == r.turn_actor_a 104 && l.turn_actor_b == r.turn_actor_b 105 && l.command_actor_id == r.command_actor_id 106 && l.command_id == r.command_id; 107 } 108 109 inline bool operator!=(const TroopPageCondition& l, const TroopPageCondition& r) { 110 return !(l == r); 111 } 112 113 std::ostream& operator<<(std::ostream& os, const TroopPageCondition& obj); 114 115 template <typename F, typename ParentCtx = Context<void,void>> 116 void ForEachString(TroopPageCondition& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 117 (void)obj; 118 (void)f; 119 (void)parent_ctx; 120 } 121 122 } // namespace rpg 123 } // namespace lcf 124 125 #endif 126