VEGO-Engine  0.1
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#include <functional>
7
8#include "Entity.h"
9
10class Vector2D;
11class Manager;
12
13enum class PowerupType
14{
15 HEART,
16 WALKINGSPEED,
17 SHOOTINGSPEED
18};
19
21{
22public:
23
24 AssetManager(Manager* manager);
26
27 void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity* owner);
28 void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, std::string texturePath);
29
37 template <typename T> [[deprecated]] T calculateRandomType(int amount);
38
39 //texture management
40 void addTexture(std::string id, const char* path);
41
42 // sound management
43 void addSoundEffect(std::string id, const char* path);
44
45 void addMusic(std::string id, const char* path);
46
47 SDL_Texture* getTexture(std::string id);
48 Mix_Chunk* getSound(std::string id);
49 Mix_Music* getMusic(std::string id);
50
51private:
52
53 Manager* man;
54 std::map<std::string, SDL_Texture*> textures;
55 std::map<std::string, Mix_Chunk*> soundEffects;
56 std::map<std::string, Mix_Music*> music;
57};
Definition AssetManager.h:21
Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea)
Calculates a random spawn position for an object within a given area.
Definition AssetManager.cpp:78
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Is responsible for managing all entities.
Definition Manager.h:23
Definition Vector2D.h:7