SDL Minigame  1.0
Loading...
Searching...
No Matches
AssetManager.h
1#pragma once
2#include <SDL_render.h>
3#include <SDL_mixer.h>
4#include <map>
5#include <string>
6
7#include "Entity.h"
8
9class Vector2D;
10class Manager;
11
12enum class PowerupType
13{
14 HEART,
15 WALKINGSPEED,
16 SHOOTINGSPEED
17};
18
20{
21public:
22
23 AssetManager(Manager* manager);
25
26 void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity::TeamLabel teamLabel);
27 void createPowerup(Vector2D pos, PowerupType type);
28
29 Vector2D calculateSpawnPosition();
30 PowerupType calculateType();
31
32 //texture management
33 void addTexture(std::string id, const char* path);
34
35 // sound management
36 void addSoundEffect(std::string id, const char* path);
37
38 SDL_Texture* getTexture(std::string id);
39 Mix_Chunk* getSound(std::string id);
40
41private:
42
43 Manager* man;
44 std::map<std::string, SDL_Texture*> textures;
45 std::map<std::string, Mix_Chunk*> soundEffects;
46};
Definition AssetManager.h:20
TeamLabel
Allows grouping entities by team association for hits, win conditions, etc.
Definition Entity.h:54
Is responsible for managing all entities.
Definition Manager.h:20
Definition Vector2D.h:7