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_ANIMATIONTIMING_H 13 #define LCF_RPG_ANIMATIONTIMING_H 14 15 // Headers 16 #include <stdint.h> 17 #include "lcf/enum_tags.h" 18 #include "lcf/rpg/sound.h" 19 #include "lcf/context.h" 20 #include <ostream> 21 #include <type_traits> 22 23 /** 24 * rpg::AnimationTiming class. 25 */ 26 namespace lcf { 27 namespace rpg { 28 class AnimationTiming { 29 public: 30 enum FlashScope { 31 FlashScope_nothing = 0, 32 FlashScope_target = 1, 33 FlashScope_screen = 2 34 }; 35 static constexpr auto kFlashScopeTags = lcf::makeEnumTags<FlashScope>( 36 "nothing", 37 "target", 38 "screen" 39 ); 40 enum ScreenShake { 41 ScreenShake_nothing = 0, 42 ScreenShake_target = 1, 43 ScreenShake_screen = 2 44 }; 45 static constexpr auto kScreenShakeTags = lcf::makeEnumTags<ScreenShake>( 46 "nothing", 47 "target", 48 "screen" 49 ); 50 51 int ID = 0; 52 int32_t frame = 0; 53 Sound se; 54 int32_t flash_scope = 0; 55 int32_t flash_red = 31; 56 int32_t flash_green = 31; 57 int32_t flash_blue = 31; 58 int32_t flash_power = 31; 59 int32_t screen_shake = 0; 60 }; 61 inline std::ostream& operator<<(std::ostream& os, AnimationTiming::FlashScope code) { 62 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 63 return os; 64 } 65 inline std::ostream& operator<<(std::ostream& os, AnimationTiming::ScreenShake code) { 66 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 67 return os; 68 } 69 70 inline bool operator==(const AnimationTiming& l, const AnimationTiming& r) { 71 return l.frame == r.frame 72 && l.se == r.se 73 && l.flash_scope == r.flash_scope 74 && l.flash_red == r.flash_red 75 && l.flash_green == r.flash_green 76 && l.flash_blue == r.flash_blue 77 && l.flash_power == r.flash_power 78 && l.screen_shake == r.screen_shake; 79 } 80 81 inline bool operator!=(const AnimationTiming& l, const AnimationTiming& r) { 82 return !(l == r); 83 } 84 85 std::ostream& operator<<(std::ostream& os, const AnimationTiming& obj); 86 87 template <typename F, typename ParentCtx = Context<void,void>> 88 void ForEachString(AnimationTiming& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 89 const auto ctx2 = Context<AnimationTiming, ParentCtx>{ "se", -1, &obj, parent_ctx }; 90 ForEachString(obj.se, f, &ctx2); 91 (void)obj; 92 (void)f; 93 (void)parent_ctx; 94 } 95 96 } // namespace rpg 97 } // namespace lcf 98 99 #endif 100