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_CHIPSET_H 13 #define LCF_RPG_CHIPSET_H 14 15 // Headers 16 #include <stdint.h> 17 #include <vector> 18 #include "lcf/dbstring.h" 19 #include "lcf/enum_tags.h" 20 #include "lcf/context.h" 21 #include <ostream> 22 #include <type_traits> 23 24 /** 25 * rpg::Chipset class. 26 */ 27 namespace lcf { 28 namespace rpg { 29 class Chipset { 30 public: 31 enum AnimType { 32 AnimType_reciprocating = 0, 33 AnimType_cyclic = 1 34 }; 35 static constexpr auto kAnimTypeTags = lcf::makeEnumTags<AnimType>( 36 "reciprocating", 37 "cyclic" 38 ); 39 40 int ID = 0; 41 DBString name; 42 DBString chipset_name; 43 std::vector<int16_t> terrain_data = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 44 std::vector<uint8_t> passable_data_lower = {15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; 45 std::vector<uint8_t> passable_data_upper = {31, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; 46 int32_t animation_type = 0; 47 int32_t animation_speed = 0; 48 }; 49 inline std::ostream& operator<<(std::ostream& os, Chipset::AnimType code) { 50 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 51 return os; 52 } 53 54 inline bool operator==(const Chipset& l, const Chipset& r) { 55 return l.name == r.name 56 && l.chipset_name == r.chipset_name 57 && l.terrain_data == r.terrain_data 58 && l.passable_data_lower == r.passable_data_lower 59 && l.passable_data_upper == r.passable_data_upper 60 && l.animation_type == r.animation_type 61 && l.animation_speed == r.animation_speed; 62 } 63 64 inline bool operator!=(const Chipset& l, const Chipset& r) { 65 return !(l == r); 66 } 67 68 std::ostream& operator<<(std::ostream& os, const Chipset& obj); 69 70 template <typename F, typename ParentCtx = Context<void,void>> 71 void ForEachString(Chipset& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 72 const auto ctx1 = Context<Chipset, ParentCtx>{ "name", -1, &obj, parent_ctx }; 73 f(obj.name, ctx1); 74 const auto ctx2 = Context<Chipset, ParentCtx>{ "chipset_name", -1, &obj, parent_ctx }; 75 f(obj.chipset_name, ctx2); 76 (void)obj; 77 (void)f; 78 (void)parent_ctx; 79 } 80 81 } // namespace rpg 82 } // namespace lcf 83 84 #endif 85