#pragma once #include #include #include #include "common/basicTypes.h" struct EventTime { //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; 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 }; enum { BOX_HEIGHT = 5 }; class Person { public: Person() = default; Person(const char* name, EventTime birth, bool sex, EventTime death); /* Person(Person&&) = default; */ /* Person& operator=(Person&&) = default; */ /* Person& operator=(const Person&) = default; */ bool operator==(const Person &other)const; void save(std::ofstream &file)const;// void load(std::ifstream &file); void rename(const char* newName); void print() const; /* Draw a Person's box on the terminal drawY,drawX - the coordinates where to draw returns the width of the box*/ void draw(U16 drawY, U16 drawX) const; WINDOW* createPad()const; /* staitc constexpr U8 BOX_HEIGHT = 5; */ friend class Tree; private: std::string name_; unsigned numRel_; //Number of close relatives - mother, father, brother, sister, wife/husband, child, ex-wife/husband EventTime birth_; bool isMale_; EventTime death_; };