-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCharacter.h
104 lines (84 loc) · 1.8 KB
/
Character.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef CHARACTER_H
#define CHARACTER_H
#include"stdafx.h"
#include"Job.h"
#include"Equipments.h"
#include"Items.h"
#include"Quest.h"
#include"Image.h"
#include"Buildings.h"
#include"Screen.h"
namespace character {
enum class MoveState {
Left,
Right,
Front,
Back
};
class Character {
private:
sf::RenderTarget* target;
//image
img::ImageFile img;
sf::Texture texture;
sf::Sprite sprite;
//info
std::string name;
MoveState moveState;
sf::Vector2f point;
job::Job job;
equipments::Equipments equipment; // put on
std::vector<items::Items> items;
quest::MainQuest quest;
ability::Ability ability;
//property
float money = 0.0f;
std::vector<screen::Stock> stock;
//state
bool isDead = false;
unsigned int hp = 10;
unsigned int level = 1;
float exp = 0.0f;
unsigned int damage = 0;
unsigned int armor = 0;
float step = 8.0f;
//func
std::string findFileName();
public:
Character();
//Character(...);
Character(const Character& character);
~Character();
//info
void setName(std::string name);
void setJob(job::Job job);
void setHP(int hp);
void setLevel(int level);
void setMoney(float money);
void setDeadFlags(bool isDead);
void setStep(float step);
void setPoint(sf::Vector2f point);
void addItem(items::Items item);
void deleteItem(items::Items item);
std::string getName();
bool getDeadFlags();
job::Job getJob();
int getHP();
unsigned int getDamage();
unsigned int getArmor();
float getExp();
int getLevel();
float getMoney();
sf::Vector2f getPoint();
float getStep();
std::vector<screen::Stock> getStock();
//acts
void move(float x, float y);
int attack();
void beAttacked(int damage);
// update & render
void update();
void render(sf::RenderTarget* target);
};
}
#endif //CHARACTER_H