add death date

This commit is contained in:
vrd
2022-09-17 20:44:44 +03:00
parent 1bf0a7f6a4
commit f69d0cbc2f
8 changed files with 43 additions and 28 deletions
+8 -8
View File
@@ -6,40 +6,40 @@
using std::cout;
BirthTime::BirthTime(U16 Year, U8 Month, U8 Day, U8 Hour, U8 Minute)
EventTime::EventTime(I16 Year, U8 Month, U16 Day, I8 Hour, I8 Minute)
: year(Year)
, month(Month)
, day(Day)
, hour(Hour)
, minute(Minute)
{
assert(month <= 12 && day <= 31 && hour <= 23 && minute <= 59 && "Invalid BirthTime data");
assert(month <= 12 && day <= 31 && hour <= 23 && minute <= 59 && "Invalid EventTime data");
}
void BirthTime::print() const
void EventTime::print() const
{
cout << "Birth: ";
if (day != UNKNOWN)
if (day != UNKNOWN_DATE)
cout << (I32)day;
else
cout << "??";
cout << '.';
if (month != UNKNOWN)
if (month != UNKNOWN_DATE)
cout << (I32)month;
else
cout << "??";
cout << '.';
if (year != UNKNOWN)
cout << (I32)year;
if (year != UNKNOWN_DATE)
cout << year;
else
cout << "????";
cout << '\n';
}
Person::Person(const char* Name, BirthTime Birth, bool IsMale)
Person::Person(const char* Name, EventTime Birth, bool IsMale)
: name(Name)
, numRel(0)
, birth(Birth)