mirror of
https://github.com/jorenchik/testing-spring-2024.git
synced 2025-10-21 20:10:36 +00:00
feat[prep]: event prohibits and allows other actions
This commit is contained in:
parent
505cf1ec10
commit
faf6d64ce0
@ -33,10 +33,42 @@ Room::Room(uint32_t id, std::string title, uint32_t utcTimestampCreatedAt, RoomS
|
|||||||
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);
|
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Event(std::string title, uint32_t utcTimestampCreatedAt, uint32_t numberNight, bool isVisible):
|
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),
|
title(title),
|
||||||
utcTimestampCreatedAt(createUTCTimestamp(utcTimestampCreatedAt)),
|
utcTimestampCreatedAt(createUTCTimestamp(utcTimestampCreatedAt)),
|
||||||
numberNight(numberNight),
|
numberNight(numberNight),
|
||||||
isVisible(isVisible) {
|
isVisible(isVisible) {
|
||||||
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);
|
this->utcTimestampCreatedAt = createUTCTimestamp(utcTimestampCreatedAt);
|
||||||
|
for (auto &a : causedBy) {
|
||||||
|
this->causedBy.push_back(a);
|
||||||
|
}
|
||||||
|
for (auto &a : prohibits) {
|
||||||
|
this->prohibits.push_back(a);
|
||||||
|
}
|
||||||
|
for (auto &a : allows) {
|
||||||
|
this->allows.push_back(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,9 +75,23 @@ struct Event {
|
|||||||
uint32_t numberNight;
|
uint32_t numberNight;
|
||||||
bool isVisible;
|
bool isVisible;
|
||||||
std::vector<Action> causedBy;
|
std::vector<Action> causedBy;
|
||||||
std::vector<Action> influenced;
|
std::vector<Action> prohibits;
|
||||||
|
std::vector<Action> allows;
|
||||||
|
|
||||||
Event(std::string title, uint32_t utcTimestampCreatedAt, uint32_t numberNight, bool isVisible);
|
Event(std::string title,
|
||||||
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user