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_SAVEACTOR_H
13 #define LCF_RPG_SAVEACTOR_H
14 
15 // Headers
16 #include <stdint.h>
17 #include <string>
18 #include <vector>
19 #include "lcf/enum_tags.h"
20 #include "lcf/context.h"
21 #include <ostream>
22 #include <type_traits>
23 
24 /**
25  * rpg::SaveActor class.
26  */
27 namespace lcf {
28 namespace rpg {
29 	class SaveActor {
30 	public:
31 		// Sentinel name used to denote that the default LDB name should be used.
32 		static constexpr const char* kEmptyName = "\x1";
33 
34 		enum RowType {
35 			RowType_front = 0,
36 			RowType_back = 1
37 		};
38 		static constexpr auto kRowTypeTags = lcf::makeEnumTags<RowType>(
39 			"front",
40 			"back"
41 		);
42 
43 		int ID = 0;
44 		std::string name = kEmptyName;
45 		std::string title = kEmptyName;
46 		std::string sprite_name;
47 		int32_t sprite_id = 0;
48 		int32_t transparency = 0;
49 		std::string face_name;
50 		int32_t face_id = 0;
51 		int32_t level = -1;
52 		int32_t exp = -1;
53 		int32_t hp_mod = -1;
54 		int32_t sp_mod = -1;
55 		int32_t attack_mod = 0;
56 		int32_t defense_mod = 0;
57 		int32_t spirit_mod = 0;
58 		int32_t agility_mod = 0;
59 		std::vector<int16_t> skills;
60 		std::vector<int16_t> equipped = {0, 0, 0, 0, 0};
61 		int32_t current_hp = -1;
62 		int32_t current_sp = -1;
63 		std::vector<int32_t> battle_commands = {-1, -1, -1, -1, -1, -1, -1};
64 		std::vector<int16_t> status;
65 		bool changed_battle_commands = false;
66 		int32_t class_id = -1;
67 		int32_t row = 0;
68 		bool two_weapon = false;
69 		bool lock_equipment = false;
70 		bool auto_battle = false;
71 		bool super_guard = false;
72 		int32_t battler_animation = 0;
73 	};
74 	inline std::ostream& operator<<(std::ostream& os, SaveActor::RowType code) {
75 		os << static_cast<std::underlying_type_t<decltype(code)>>(code);
76 		return os;
77 	}
78 
79 	inline bool operator==(const SaveActor& l, const SaveActor& r) {
80 		return l.name == r.name
81 		&& l.title == r.title
82 		&& l.sprite_name == r.sprite_name
83 		&& l.sprite_id == r.sprite_id
84 		&& l.transparency == r.transparency
85 		&& l.face_name == r.face_name
86 		&& l.face_id == r.face_id
87 		&& l.level == r.level
88 		&& l.exp == r.exp
89 		&& l.hp_mod == r.hp_mod
90 		&& l.sp_mod == r.sp_mod
91 		&& l.attack_mod == r.attack_mod
92 		&& l.defense_mod == r.defense_mod
93 		&& l.spirit_mod == r.spirit_mod
94 		&& l.agility_mod == r.agility_mod
95 		&& l.skills == r.skills
96 		&& l.equipped == r.equipped
97 		&& l.current_hp == r.current_hp
98 		&& l.current_sp == r.current_sp
99 		&& l.battle_commands == r.battle_commands
100 		&& l.status == r.status
101 		&& l.changed_battle_commands == r.changed_battle_commands
102 		&& l.class_id == r.class_id
103 		&& l.row == r.row
104 		&& l.two_weapon == r.two_weapon
105 		&& l.lock_equipment == r.lock_equipment
106 		&& l.auto_battle == r.auto_battle
107 		&& l.super_guard == r.super_guard
108 		&& l.battler_animation == r.battler_animation;
109 	}
110 
111 	inline bool operator!=(const SaveActor& l, const SaveActor& r) {
112 		return !(l == r);
113 	}
114 
115 	std::ostream& operator<<(std::ostream& os, const SaveActor& obj);
116 
117 	template <typename F, typename ParentCtx = Context<void,void>>
118 	void ForEachString(SaveActor& obj, const F& f, const ParentCtx* parent_ctx = nullptr) {
119 		(void)obj;
120 		(void)f;
121 		(void)parent_ctx;
122 	}
123 
124 } // namespace rpg
125 } // namespace lcf
126 
127 #endif
128