Files
tft/person.h
T
2022-08-27 16:35:40 +03:00

39 lines
823 B
C++

#pragma once
#include <string>
#include <fstream>
#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, BirthTime Birth, bool Sex);
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;
friend class Tree;
private:
std::string name;
unsigned numRel; //Number of close relatives - mother, father, brother, sister, wife/husband, child, ex-wife/husband
BirthTime birth;
bool isMale;
};