feat: remove caused by from event

This commit is contained in:
Jorens Shtekels 2024-03-12 21:01:44 +02:00
parent 6fdf800fbd
commit db4a4be369
3 changed files with 3 additions and 12 deletions

View File

@ -23,9 +23,9 @@ void run() {
const Action vote = Action("vote", true);
Role role1({vote, kill, heal});
Role role2({heal});
Event event1 = Event("Event 1", 1710087355, 1, true, {vote}, {}, {});
Event event2 = Event("Event 2", 1710087363, 1, true, {}, {kill}, {});
Event event3 = Event("Event 3", 1710087369, 1, true, {}, {}, {kill});
Event event1 = Event("Event 1", 1710087355, 1, true, {}, {});
Event event2 = Event("Event 2", 1710087363, 1, true, {kill}, {});
Event event3 = Event("Event 3", 1710087369, 1, true, {}, {kill});
std::vector<Event> relatedEvents({event2, event3});
Player player1 = Player("player1", role1, PlayerStatus::ALIVE);
Player player2 = Player("player2", role1, PlayerStatus::ALIVE);

View File

@ -46,7 +46,6 @@ Event::Event(std::string title,
uint32_t utcTimestampCreatedAt,
uint32_t numberNight,
bool isVisible,
std::vector<Action> causedBy,
std::vector<Action> prohibits,
std::vector<Action> allows):
title(title),
@ -54,9 +53,6 @@ Event::Event(std::string title,
numberNight(numberNight),
isVisible(isVisible) {
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);
for (auto &a : causedBy) {
this->causedBy.push_back(a);
}
for (auto &a : prohibits) {
this->prohibits.push_back(a);
}
@ -69,14 +65,12 @@ Event::Event(std::string title,
uint32_t utcTimestampCreatedAt,
uint32_t numberNight,
bool isVisible,
std::initializer_list<Action> causedBy,
std::initializer_list<Action> prohibits,
std::initializer_list<Action> allows):
Event(title,
utcTimestampCreatedAt,
numberNight,
isVisible,
std::vector<Action>(causedBy),
std::vector<Action>(prohibits),
std::vector<Action>(allows)) {
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);

View File

@ -74,7 +74,6 @@ struct Event {
std::tm *utcTimestampCreatedAt;
uint32_t numberNight;
bool isVisible;
std::vector<Action> causedBy;
std::vector<Action> prohibits;
std::vector<Action> allows;
@ -86,14 +85,12 @@ struct Event {
uint32_t utcTimestampCreatedAt,
uint32_t numberNight,
bool isVisible,
std::vector<Action> causedBy,
std::vector<Action> prohibits,
std::vector<Action> allows);
Event(std::string title,
uint32_t utcTimestampCreatedAt,
uint32_t numberNight,
bool isVisible,
std::initializer_list<Action> causedBy,
std::initializer_list<Action> prohibits,
std::initializer_list<Action> allows);
};