#pragma once #include #include #include #include #include #include "Entity.h" class Vector2D; class Manager; enum class PowerupType { HEART, WALKINGSPEED, SHOOTINGSPEED }; class AssetManager { public: AssetManager(Manager* manager); ~AssetManager(); void createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char* texturePath, Entity* owner); void createPowerup(Vector2D pos, std::function pickupFunc, std::string texturePath); /*! * \brief Calculates a random spawn position for an object within a given area * \param size The size (collision box) of the object * \param spawnArea The area within which a spawn position will be calculated * \returns Spawn Coordinates for the object */ Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea); template [[deprecated]] T calculateRandomType(int amount); //texture management void addTexture(std::string id, const char* path); // sound management void addSoundEffect(std::string id, const char* path); void addMusic(std::string id, const char* path); SDL_Texture* getTexture(std::string id); Mix_Chunk* getSound(std::string id); Mix_Music* getMusic(std::string id); private: Manager* man; std::map textures; std::map soundEffects; std::map music; };