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_MOVEROUTE_H 13 #define LCF_RPG_MOVEROUTE_H 14 15 // Headers 16 #include <vector> 17 #include "lcf/rpg/movecommand.h" 18 #include "lcf/context.h" 19 #include <ostream> 20 #include <type_traits> 21 22 /** 23 * rpg::MoveRoute class. 24 */ 25 namespace lcf { 26 namespace rpg { 27 class MoveRoute { 28 public: 29 std::vector<MoveCommand> move_commands; 30 bool repeat = true; 31 bool skippable = false; 32 }; 33 34 inline bool operator==(const MoveRoute& l, const MoveRoute& r) { 35 return l.move_commands == r.move_commands 36 && l.repeat == r.repeat 37 && l.skippable == r.skippable; 38 } 39 40 inline bool operator!=(const MoveRoute& l, const MoveRoute& r) { 41 return !(l == r); 42 } 43 44 std::ostream& operator<<(std::ostream& os, const MoveRoute& obj); 45 46 template <typename F, typename ParentCtx = Context<void,void>> 47 void ForEachString(MoveRoute& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 48 for (int i = 0; i < static_cast<int>(obj.move_commands.size()); ++i) { 49 const auto ctx1 = Context<MoveRoute, ParentCtx>{ "move_commands", i, &obj, parent_ctx }; 50 ForEachString(obj.move_commands[i], f, &ctx1); 51 } 52 (void)obj; 53 (void)f; 54 (void)parent_ctx; 55 } 56 57 } // namespace rpg 58 } // namespace lcf 59 60 #endif 61