-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeapon.h
58 lines (40 loc) · 1.2 KB
/
Weapon.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
#pragma once
#include "Item.h"
class Weapon :
public Item
{
private:
// private: Functions:
void initVariables();
void initTexture(const std::string file_path);
protected:
// Variables:
sf::Sprite weaponSprite;
sf::Texture weaponTexture;
int damageMin;
int damageMax;
float range;
sf::Clock attackTimer;
int32_t attackTimerMax; // Milliseconds
public:
// Constructors and Destructor:
Weapon(const int level, const int value, const std::string& texture_file_path);
Weapon
(
const int level, const int damage_min, const int damage_max, const float range,
const int value,
const std::string& texture_file_path
);
virtual ~Weapon();
// Accessors:
const int& getDamageMin() const;
const int& getDamageMax() const;
const int getDamage() const;
const float& getRange() const;
const bool getAttackTimer();
// Functions:
virtual Weapon* clone() = 0;
virtual void generate(const int level_min, const int level_max) = 0;
virtual void update(const sf::Vector2f& mouse_position_view, const sf::Vector2f center) = 0;
virtual void render(sf::RenderTarget& target, sf::Shader* shader = nullptr) = 0;
};