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_MOVECOMMAND_H
13 #define LCF_RPG_MOVECOMMAND_H
14 
15 // Headers
16 #include <stdint.h>
17 #include "lcf/dbstring.h"
18 #include "lcf/enum_tags.h"
19 #include "lcf/context.h"
20 #include <ostream>
21 #include <type_traits>
22 
23 /**
24  * rpg::MoveCommand class.
25  */
26 namespace lcf {
27 namespace rpg {
28 	class MoveCommand {
29 	public:
30 		enum class Code {
31 			move_up = 0,
32 			move_right = 1,
33 			move_down = 2,
34 			move_left = 3,
35 			move_upright = 4,
36 			move_downright = 5,
37 			move_downleft = 6,
38 			move_upleft = 7,
39 			move_random = 8,
40 			move_towards_hero = 9,
41 			move_away_from_hero = 10,
42 			move_forward = 11,
43 			face_up = 12,
44 			face_right = 13,
45 			face_down = 14,
46 			face_left = 15,
47 			turn_90_degree_right = 16,
48 			turn_90_degree_left = 17,
49 			turn_180_degree = 18,
50 			turn_90_degree_random = 19,
51 			face_random_direction = 20,
52 			face_hero = 21,
53 			face_away_from_hero = 22,
54 			wait = 23,
55 			begin_jump = 24,
56 			end_jump = 25,
57 			lock_facing = 26,
58 			unlock_facing = 27,
59 			increase_movement_speed = 28,
60 			decrease_movement_speed = 29,
61 			increase_movement_frequence = 30,
62 			decrease_movement_frequence = 31,
63 			switch_on = 32,
64 			switch_off = 33,
65 			change_graphic = 34,
66 			play_sound_effect = 35,
67 			walk_everywhere_on = 36,
68 			walk_everywhere_off = 37,
69 			stop_animation = 38,
70 			start_animation = 39,
71 			increase_transp = 40,
72 			decrease_transp = 41
73 		};
74 		static constexpr auto kCodeTags = lcf::makeEnumTags<Code>(
75 			"move_up",
76 			"move_right",
77 			"move_down",
78 			"move_left",
79 			"move_upright",
80 			"move_downright",
81 			"move_downleft",
82 			"move_upleft",
83 			"move_random",
84 			"move_towards_hero",
85 			"move_away_from_hero",
86 			"move_forward",
87 			"face_up",
88 			"face_right",
89 			"face_down",
90 			"face_left",
91 			"turn_90_degree_right",
92 			"turn_90_degree_left",
93 			"turn_180_degree",
94 			"turn_90_degree_random",
95 			"face_random_direction",
96 			"face_hero",
97 			"face_away_from_hero",
98 			"wait",
99 			"begin_jump",
100 			"end_jump",
101 			"lock_facing",
102 			"unlock_facing",
103 			"increase_movement_speed",
104 			"decrease_movement_speed",
105 			"increase_movement_frequence",
106 			"decrease_movement_frequence",
107 			"switch_on",
108 			"switch_off",
109 			"change_graphic",
110 			"play_sound_effect",
111 			"walk_everywhere_on",
112 			"walk_everywhere_off",
113 			"stop_animation",
114 			"start_animation",
115 			"increase_transp",
116 			"decrease_transp"
117 		);
118 
119 		int32_t command_id = 0;
120 		DBString parameter_string;
121 		int32_t parameter_a = 0;
122 		int32_t parameter_b = 0;
123 		int32_t parameter_c = 0;
124 	};
125 	inline std::ostream& operator<<(std::ostream& os, MoveCommand::Code code) {
126 		os << static_cast<std::underlying_type_t<decltype(code)>>(code);
127 		return os;
128 	}
129 
130 	inline bool operator==(const MoveCommand& l, const MoveCommand& r) {
131 		return l.command_id == r.command_id
132 		&& l.parameter_string == r.parameter_string
133 		&& l.parameter_a == r.parameter_a
134 		&& l.parameter_b == r.parameter_b
135 		&& l.parameter_c == r.parameter_c;
136 	}
137 
138 	inline bool operator!=(const MoveCommand& l, const MoveCommand& r) {
139 		return !(l == r);
140 	}
141 
142 	std::ostream& operator<<(std::ostream& os, const MoveCommand& obj);
143 
144 	template <typename F, typename ParentCtx = Context<void,void>>
145 	void ForEachString(MoveCommand& obj, const F& f, const ParentCtx* parent_ctx = nullptr) {
146 		const auto ctx2 = Context<MoveCommand, ParentCtx>{ "parameter_string", -1, &obj, parent_ctx };
147 		f(obj.parameter_string, ctx2);
148 		(void)obj;
149 		(void)f;
150 		(void)parent_ctx;
151 	}
152 
153 } // namespace rpg
154 } // namespace lcf
155 
156 #endif
157