diff --git a/src/action.cc b/src/action.cc new file mode 100644 index 0000000..ebe63bf --- /dev/null +++ b/src/action.cc @@ -0,0 +1,10 @@ +#include "action.hh" + +Action::Action(std::string name, bool has_target) { + this->name = name; + this->has_target = has_target; +} + +bool Action::operator==(const Action &other) const { + return this->name == other.name; +} diff --git a/src/action.hh b/src/action.hh new file mode 100644 index 0000000..3a9503c --- /dev/null +++ b/src/action.hh @@ -0,0 +1,13 @@ +#ifndef ACTION_HH +#define ACTION_HH +#include + +struct Action { + std::string name; + bool has_target; + + Action(std::string name, bool has_target); + bool operator==(const Action &other) const; +}; + +#endif // ACTION_HH diff --git a/src/lib.hh b/src/lib.hh index 72ad37b..8ecf9a8 100644 --- a/src/lib.hh +++ b/src/lib.hh @@ -1,3 +1,4 @@ +#include "action.hh" #include "prep/prep.hh" bool playerBelongsToRoom(Player *player, Room *room); diff --git a/src/prep/prep.cc b/src/prep/prep.cc index aabfd4c..271aaf4 100644 --- a/src/prep/prep.cc +++ b/src/prep/prep.cc @@ -5,15 +5,6 @@ #include #include -Action::Action(std::string name, bool hasTarget) { - this->name = name; - this->hasTarget = hasTarget; -} - -bool Action::operator==(const Action &other) const { - return this->name == other.name; -} - Role::Role(std::initializer_list actions): Role(std::vector(actions)) { } diff --git a/src/prep/prep.hh b/src/prep/prep.hh index d99d6fd..5637e12 100644 --- a/src/prep/prep.hh +++ b/src/prep/prep.hh @@ -33,14 +33,6 @@ struct Player; struct Room; struct Event; -struct Action { - std::string name; - bool hasTarget; - - Action(std::string name, bool hasTarget); - bool operator==(const Action &other) const; -}; - struct Role { std::vector actions;