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_BATTLECOMMAND_H
13 #define LCF_RPG_BATTLECOMMAND_H
14 
15 // Headers
16 #include "lcf/dbstring.h"
17 #include "lcf/enum_tags.h"
18 #include "lcf/context.h"
19 #include <ostream>
20 #include <type_traits>
21 
22 /**
23  * rpg::BattleCommand class.
24  */
25 namespace lcf {
26 namespace rpg {
27 	class BattleCommand {
28 	public:
29 		enum Type {
30 			Type_attack = 0,
31 			Type_skill = 1,
32 			Type_subskill = 2,
33 			Type_defense = 3,
34 			Type_item = 4,
35 			Type_escape = 5,
36 			Type_special = 6
37 		};
38 		static constexpr auto kTypeTags = lcf::makeEnumTags<Type>(
39 			"attack",
40 			"skill",
41 			"subskill",
42 			"defense",
43 			"item",
44 			"escape",
45 			"special"
46 		);
47 
48 		int ID = 0;
49 		DBString name;
50 		int32_t type = 0;
51 	};
52 	inline std::ostream& operator<<(std::ostream& os, BattleCommand::Type code) {
53 		os << static_cast<std::underlying_type_t<decltype(code)>>(code);
54 		return os;
55 	}
56 
57 	inline bool operator==(const BattleCommand& l, const BattleCommand& r) {
58 		return l.name == r.name
59 		&& l.type == r.type;
60 	}
61 
62 	inline bool operator!=(const BattleCommand& l, const BattleCommand& r) {
63 		return !(l == r);
64 	}
65 
66 	std::ostream& operator<<(std::ostream& os, const BattleCommand& obj);
67 
68 	template <typename F, typename ParentCtx = Context<void,void>>
69 	void ForEachString(BattleCommand& obj, const F& f, const ParentCtx* parent_ctx = nullptr) {
70 		const auto ctx1 = Context<BattleCommand, ParentCtx>{ "name", -1, &obj, parent_ctx };
71 		f(obj.name, ctx1);
72 		(void)obj;
73 		(void)f;
74 		(void)parent_ctx;
75 	}
76 
77 } // namespace rpg
78 } // namespace lcf
79 
80 #endif
81