-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayer.h
48 lines (36 loc) · 867 Bytes
/
player.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
#ifndef PLAYER_H
#define PLAYER_H
#include <iostream>
#include "entity.h"
#include "utils.h"
#define N_SHOOTING_TIME_MS 500
#define N_RELOADING_TIME_MS 1500
struct Ammo {
int baseDamage;
int damage(float range);
char symbol;
};
struct TimingsMs { // if the timing is -1, means it is not happening
int reloading;
int shooting;
};
class Player : public Entity {
private:
utils::Logger logger;
std::string _HUD;
std::string _gun;
public:
TimingsMs timings;
bool reloading(float fMoment);
bool shooting(float fMoment);
int nAmmoCount;
Ammo aCurrentAmmo;
int damageIndicator;
int score;
Player();
void shoot(float fMoment); // inicializes the timing.shooting and reduces ammo
void reload(float fMoment); // identical to shoot
std::string getHUD();
std::string getgun();
};
#endif