-
Notifications
You must be signed in to change notification settings - Fork 1
/
animationhelper.h
63 lines (54 loc) · 1.27 KB
/
animationhelper.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
// animation.h
//
// Used as a singleton helper class for all
// other objects in the rts "namespace".
// Shared instance necessary. Defines all the
// references to sprites through enum
// definition.
#pragma once
#include <SFML/Graphics.hpp> // for use of Texture and Sprite
#include <SFML/Graphics/Color.hpp> // for use of Color class
#include <SFML/Graphics/Image.hpp> // for use of Image class
using namespace sf;
class AnimationHelper {
public:
enum class HelmetType {
SabreToothHead,
BobbedWithBone,
AztecBirdHeaddress,
JaguarHead,
EgyptianKhat,
};
enum class spriteDesc {
Stand,
Walk1,
Walk2,
Slash1,
Slash2,
Shoot,
Flee1,
Flee2,
};
enum class spriteDir {
Right,
Left,
Down,
Up
};
enum class spriteColor {
Blue,
Red,
Green,
Purple
};
static AnimationHelper* Instance();
void setSheet(std::string filepath);
Sprite* getSoldier(spriteColor color, spriteDesc description, spriteDir dir, int x_draw, int y_draw);
//Sprite* getHelmet(spriteColor color, HelmetType helm, spriteDir dir, bool fleeing, int x_draw, int y_draw);
Sprite* getUtility(int x, int y, int width, int height, int x_draw, int y_draw);
private:
AnimationHelper(){}
static AnimationHelper* m_pInstance;
Texture sharedTexture;
Sprite sharedSprite;
};