-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHuman.h
More file actions
37 lines (30 loc) · 1019 Bytes
/
Human.h
File metadata and controls
37 lines (30 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#ifndef _HUMAN_H_
#define _HUMAN_H_
#include <string>
#include "Apple.h"
class Human
{
private:
//Свойства класса (поля)
int age;
std::string name;
int humanID;
static int ID;
public:
Human(); //Конструктор по-умолчанию
Human(int age, std::string name); //Перегрузка конструктора
Human(std::string name);
Human(std::string name, int age); //Делигирующий конструктор
~Human(); //Деструктор
Human(const Human& other); //Конструктор копирования
Human& operator= (const Human& other); //Перегрузка оператора =
void PrintInfo(); //Метод (функция)
void SetAge(int valueAge); //Сеттер
void SetName(std::string name);
std::string GetName(); //Геттер
int GetAge();
int GetID();
//void TakeApple(Apple& apple); //Определение методов вне класса
};
#endif // !_HUMAN_H_