-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssets.h
More file actions
59 lines (53 loc) · 1.15 KB
/
Assets.h
File metadata and controls
59 lines (53 loc) · 1.15 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
54
55
56
57
58
59
#pragma once
#include "olcPixelGameEngine.h"
#include "olcSoundWaveEngine.h"
//#include "olcPGEX_Sound.h"
#include <map>
class cMap;
class cItem;
class cSpell;
class RPG_Assets
{
public:
olc::sound::Wave sample1;
static RPG_Assets& get()
{
static RPG_Assets me;
return me;
}
RPG_Assets(RPG_Assets const&) = delete;
void operator=(RPG_Assets const&) = delete;
olc::Sprite* GetSprite(std::string name)
{
return m_mapSprites[name];
}
cMap* GetMap(std::string name)
{
return m_mapMaps[name];
}
cItem* GetItem(std::string name)
{
return m_mapItems[name];
}
cSpell* GetSpell(std::string name)
{
return m_mapSpells[name];
}
olc::sound::Wave* GetSound(std::string name)
{
return m_mapSounds[name];
}
void LoadSprites();
void LoadMaps();
void LoadSounds();
void LoadItems();
void LoadSpells();
private:
RPG_Assets();
~RPG_Assets();//0.0
std::map<std::string, olc::Sprite*> m_mapSprites;
std::map<std::string, olc::sound::Wave*> m_mapSounds;
std::map<std::string, cMap*> m_mapMaps;
std::map<std::string, cItem*> m_mapItems;
std::map<std::string, cSpell*> m_mapSpells;
};