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
+15 -9
View File
@@ -4,14 +4,19 @@
#include <fstream>
#include "common/basicTypes.h"
struct BirthTime
struct EventTime
{
static const U16 UNKNOWN = 0;
/*explicit*/ BirthTime(U16 Year=UNKNOWN, U8 Month=UNKNOWN, U8 Day=UNKNOWN, U8 Hour=UNKNOWN, U8 Minute=UNKNOWN);
//enum { UNKNOWN_DATE=0, UNKNOWN_TIME=1};
static const I16 UNKNOWN_DATE = 0;
static const I8 UNKNOWN_TIME = -1;
/*explicit*/ EventTime(I16 Year=UNKNOWN_DATE, U8 Month=UNKNOWN_DATE, U16 Day=UNKNOWN_DATE, I8 Hour=UNKNOWN_TIME, I8 Minute=UNKNOWN_TIME);
void print() const;
U16 year;
U8 month, day, hour, minute;
I16 year; //The year in relation to Chritst's birth - 1 (AD) is the year He was born, -1 (BC) is the previous year. There is no year 0
U8 month;
U16 day;
I8 hour; //0-23
I8 minute; //0-59
};
class Person
@@ -19,7 +24,7 @@ class Person
public:
Person() = default;
Person(const char* Name, BirthTime Birth, bool Sex);
Person(const char* Name, EventTime Birth, bool Sex);
bool operator==(const Person &other)const;
@@ -32,7 +37,8 @@ public:
private:
std::string name;
unsigned numRel; //Number of close relatives - mother, father, brother, sister, wife/husband, child, ex-wife/husband
BirthTime birth;
bool isMale;
unsigned numRel; //Number of close relatives - mother, father, brother, sister, wife/husband, child, ex-wife/husband
EventTime birth;
bool isMale;
EventTime death;
};