-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpriteman.h
More file actions
53 lines (40 loc) · 1.19 KB
/
Spriteman.h
File metadata and controls
53 lines (40 loc) · 1.19 KB
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
////////////////////////////////////////////////////////////////////////////////
//
// Cspriteman : classe singleton gerant l'image, sa découpe et sa repartition
// en different sprites
//
////////////////////////////////////////////////////////////////////////////////
#ifndef DEF_CLASS_SPRITEMAN
#define DEF_CLASS_SPRITEMAN
#include <iostream>
#include <SFML/Graphics.hpp>
#include <vector>
#include <string>
#include "constants.h"
using namespace std;
using namespace sf;
class Cspriteman
{
private:
// Attributs
Image m_sprSheetImg;
vector<Sprite> m_subSpr;
vector<Sprite> m_subDecal;
static Cspriteman *_singleton;
// Le destructeur et le constructeurs sont privés, il s'agit d'une classe
// singleton
Cspriteman(string const& e_imgPath);
~Cspriteman();
public:
// Methodes
// Getters
// Retourne un sprite du tableau de sprites
Sprite GetSpr(unsigned int e_type);
Sprite GetDecal(unsigned int e_type);
// toString
string toString();
// Methodes statiques, d'initiallisation et de destruction du Singleton
static Cspriteman *Initialize(string const& e_imgPath);
static void kill();
};
#endif