liblcf
rpg_eventpagecondition.h
Go to the documentation of this file.
1 /* !!!! GENERATED FILE - DO NOT EDIT !!!!
2  * --------------------------------------
3  *
4  * This file is part of liblcf. Copyright (c) 2020 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_EVENTPAGECONDITION_H
13 #define LCF_RPG_EVENTPAGECONDITION_H
14 
15 // Headers
16 #include <array>
17 #include <stdint.h>
18 #include "enum_tags.h"
19 
23 namespace RPG {
25  public:
26  enum Comparison {
33  };
34  static constexpr auto kComparisonTags = makeEnumTags<Comparison>(
35  "equal",
36  "greater_equal",
37  "less_equal",
38  "greater",
39  "less",
40  "not_equal"
41  );
42 
43  struct Flags {
44  union {
45  struct {
46  bool switch_a;
47  bool switch_b;
48  bool variable;
49  bool item;
50  bool actor;
51  bool timer;
52  bool timer2;
53  };
54  std::array<bool, 7> flags;
55  };
56  //TODO: Should try to switch to member initializers when we upgrade to VS2017.
57  Flags() noexcept: switch_a(false), switch_b(false), variable(false), item(false), actor(false), timer(false), timer2(false)
58  {}
59  } flags;
60  int32_t switch_a_id = 1;
61  int32_t switch_b_id = 1;
62  int32_t variable_id = 1;
63  int32_t variable_value = 0;
64  int32_t item_id = 1;
65  int32_t actor_id = 1;
66  int32_t timer_sec = 0;
67  int32_t timer2_sec = 0;
68  int32_t compare_operator = 1;
69  };
70 
72  return l.flags == r.flags;
73  }
74 
76  return !(l == r);
77  }
78 
79  inline bool operator==(const EventPageCondition& l, const EventPageCondition& r) {
80  return l.flags == r.flags
81  && l.switch_a_id == r.switch_a_id
82  && l.switch_b_id == r.switch_b_id
83  && l.variable_id == r.variable_id
85  && l.item_id == r.item_id
86  && l.actor_id == r.actor_id
87  && l.timer_sec == r.timer_sec
88  && l.timer2_sec == r.timer2_sec
90  }
91 
92  inline bool operator!=(const EventPageCondition& l, const EventPageCondition& r) {
93  return !(l == r);
94  }
95 }
96 
97 #endif
static constexpr auto kComparisonTags
struct RPG::EventPageCondition::Flags flags
Definition: rpg_actor.h:26
bool operator==(const Actor &l, const Actor &r)
Definition: rpg_actor.h:64
bool operator!=(const Actor &l, const Actor &r)
Definition: rpg_actor.h:98