feat: removed push initialization of vectors

This commit is contained in:
Jorens Shtekels 2024-03-12 22:41:47 +02:00
parent 423669ab42
commit cb7927a6fc

View File

@ -18,16 +18,10 @@ bool Action::operator==(const Action &other) const {
return this->name == other.name;
}
Role::Role(std::initializer_list<Action> actions) {
for (auto &a : actions) {
this->actions.push_back(a);
}
Role::Role(std::initializer_list<Action> actions): Role(std::vector<Action>(actions)) {
}
Role::Role(std::vector<Action> actions) {
for (auto &a : actions) {
this->actions.push_back(a);
}
Role::Role(std::vector<Action> 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,