add death date
This commit is contained in:
+8
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user