diff --git a/src/action.cc b/src/action.cc index ebe63bf..5ad180c 100644 --- a/src/action.cc +++ b/src/action.cc @@ -1,5 +1,7 @@ #include "action.hh" +#include + Action::Action(std::string name, bool has_target) { this->name = name; this->has_target = has_target; diff --git a/src/lib.hh b/src/lib.hh index 8ecf9a8..ac5d9df 100644 --- a/src/lib.hh +++ b/src/lib.hh @@ -1,5 +1,6 @@ #include "action.hh" #include "prep/prep.hh" +#include "role.hh" bool playerBelongsToRoom(Player *player, Room *room); bool actionBelongsToRole(Role *role, const Action *action); diff --git a/src/prep/prep.cc b/src/prep/prep.cc index 271aaf4..ff0baa1 100644 --- a/src/prep/prep.cc +++ b/src/prep/prep.cc @@ -5,12 +5,6 @@ #include #include -Role::Role(std::initializer_list actions): Role(std::vector(actions)) { -} - -Role::Role(std::vector actions): actions(actions) { -} - Player::Player(uint32_t id, std::string username, Role role, PlayerStatus playerStatus): id(id), username(username), diff --git a/src/prep/prep.hh b/src/prep/prep.hh index 5637e12..35e43a5 100644 --- a/src/prep/prep.hh +++ b/src/prep/prep.hh @@ -28,18 +28,10 @@ enum PlayerStatus { VOTED_OUT, }; -struct Role; struct Player; struct Room; struct Event; -struct Role { - std::vector actions; - - Role(std::initializer_list actions); - Role(std::vector actions); -}; - struct Player { uint32_t id; std::string username; diff --git a/src/role.cc b/src/role.cc new file mode 100644 index 0000000..9ed7d94 --- /dev/null +++ b/src/role.cc @@ -0,0 +1,10 @@ +#include "role.hh" + +#include +#include + +Role::Role(std::initializer_list actions): Role(std::vector(actions)) { +} + +Role::Role(std::vector actions): actions(actions) { +} diff --git a/src/role.hh b/src/role.hh new file mode 100644 index 0000000..d52330f --- /dev/null +++ b/src/role.hh @@ -0,0 +1,15 @@ +#ifndef ROLE_HH +#define ROLE_HH + +#include "action.hh" + +#include +#include + +struct Role { + std::vector actions; + Role(std::initializer_list actions); + Role(std::vector actions); +}; + +#endif // ROLE_HH