use typedefed types, BirthTime

This commit is contained in:
vrd
2022-08-27 16:35:40 +03:00
parent fbfe017284
commit 1bf0a7f6a4
8 changed files with 397 additions and 385 deletions
+17 -9
View File
@@ -1,16 +1,25 @@
#pragma once
#pragma once
#include <string>
#include <fstream>
#include "common/basicTypes.h"
#include "common/basicTypes.h"
struct BirthTime
{
static const U16 UNKNOWN = 0;
/*explicit*/ BirthTime(U16 Year=UNKNOWN, U8 Month=UNKNOWN, U8 Day=UNKNOWN, U8 Hour=UNKNOWN, U8 Minute=UNKNOWN);
void print() const;
U16 year;
U8 month, day, hour, minute;
};
class Person
{
public:
Person() = default;
Person(const char* Name, unsigned char Day, unsigned char Monthay, short Year, bool Sex);
//
Person& operator=(const Person &other);
~Person();
Person(const char* Name, BirthTime Birth, bool Sex);
bool operator==(const Person &other)const;
@@ -22,9 +31,8 @@ public:
friend class Tree;
private:
char *name;
std::string name;
unsigned numRel; //Number of close relatives - mother, father, brother, sister, wife/husband, child, ex-wife/husband
unsigned char day, month; //Birth
short year;
BirthTime birth;
bool isMale;
};