diff --git a/src/prep/prep.cpp b/src/prep/prep.cpp index 52253dc..c389448 100644 --- a/src/prep/prep.cpp +++ b/src/prep/prep.cpp @@ -18,16 +18,10 @@ bool Action::operator==(const Action &other) const { return this->name == other.name; } -Role::Role(std::initializer_list actions) { - for (auto &a : actions) { - this->actions.push_back(a); - } +Role::Role(std::initializer_list actions): Role(std::vector(actions)) { } -Role::Role(std::vector actions) { - for (auto &a : actions) { - this->actions.push_back(a); - } +Role::Role(std::vector actions): actions(actions) { } Player::Player(uint32_t id, std::string username, Role role, PlayerStatus playerStatus): @@ -68,14 +62,10 @@ Event::Event(std::string title, title(title), utcTimestampCreatedAt(createUTCTimestamp(utcTimestampCreatedAt)), numberNight(numberNight), - isVisible(isVisible) { + isVisible(isVisible), + prohibits(prohibits), + allows(allows) { this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt); - for (auto &a : prohibits) { - this->prohibits.push_back(a); - } - for (auto &a : allows) { - this->allows.push_back(a); - } } Event::Event(std::string title,