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_SAVEMAPINFO_H 13 #define LCF_RPG_SAVEMAPINFO_H 14 15 // Headers 16 #include <stdint.h> 17 #include <string> 18 #include <vector> 19 #include "lcf/rpg/savemapevent.h" 20 #include "lcf/context.h" 21 #include <ostream> 22 #include <type_traits> 23 24 /** 25 * rpg::SaveMapInfo class. 26 */ 27 namespace lcf { 28 namespace rpg { 29 class SaveMapInfo { 30 public: 31 int32_t position_x = 0; 32 int32_t position_y = 0; 33 int32_t encounter_rate = -1; 34 int32_t chipset_id = 0; 35 std::vector<SaveMapEvent> events; 36 std::vector<uint8_t> lower_tiles = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; 37 std::vector<uint8_t> upper_tiles = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; 38 std::string parallax_name; 39 bool parallax_horz = false; 40 bool parallax_vert = false; 41 bool parallax_horz_auto = false; 42 int32_t parallax_horz_speed = 0; 43 bool parallax_vert_auto = false; 44 int32_t parallax_vert_speed = 0; 45 }; 46 47 inline bool operator==(const SaveMapInfo& l, const SaveMapInfo& r) { 48 return l.position_x == r.position_x 49 && l.position_y == r.position_y 50 && l.encounter_rate == r.encounter_rate 51 && l.chipset_id == r.chipset_id 52 && l.events == r.events 53 && l.lower_tiles == r.lower_tiles 54 && l.upper_tiles == r.upper_tiles 55 && l.parallax_name == r.parallax_name 56 && l.parallax_horz == r.parallax_horz 57 && l.parallax_vert == r.parallax_vert 58 && l.parallax_horz_auto == r.parallax_horz_auto 59 && l.parallax_horz_speed == r.parallax_horz_speed 60 && l.parallax_vert_auto == r.parallax_vert_auto 61 && l.parallax_vert_speed == r.parallax_vert_speed; 62 } 63 64 inline bool operator!=(const SaveMapInfo& l, const SaveMapInfo& r) { 65 return !(l == r); 66 } 67 68 std::ostream& operator<<(std::ostream& os, const SaveMapInfo& obj); 69 70 template <typename F, typename ParentCtx = Context<void,void>> 71 void ForEachString(SaveMapInfo& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 72 for (int i = 0; i < static_cast<int>(obj.events.size()); ++i) { 73 const auto ctx5 = Context<SaveMapInfo, ParentCtx>{ "events", i, &obj, parent_ctx }; 74 ForEachString(obj.events[i], f, &ctx5); 75 } 76 (void)obj; 77 (void)f; 78 (void)parent_ctx; 79 } 80 81 } // namespace rpg 82 } // namespace lcf 83 84 #endif 85