diff --git a/AssetManager_8h_source.html b/AssetManager_8h_source.html index 54aaee5..6a96e60 100644 --- a/AssetManager_8h_source.html +++ b/AssetManager_8h_source.html @@ -152,30 +152,31 @@ $(function(){initNavTree('AssetManager_8h_source.html',''); initResizable(true);
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
-
30 Vector2D calculateSpawnPosition();
-
31 PowerupType calculateType();
-
32
-
33 //texture management
-
34 void addTexture(std::string id, const char* path);
-
35
-
36 // sound management
-
37 void addSoundEffect(std::string id, const char* path);
+
36 Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea);
+
37 template <typename T> [[deprecated]] T calculateRandomType(int amount);
38
-
39 void addMusic(std::string id, const char* path);
-
40
-
41 SDL_Texture* getTexture(std::string id);
-
42 Mix_Chunk* getSound(std::string id);
-
43 Mix_Music* getMusic(std::string id);
+
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
-
45private:
+
45 void addMusic(std::string id, const char* path);
46
-
47 Manager* man;
-
48 std::map<std::string, SDL_Texture*> textures;
-
49 std::map<std::string, Mix_Chunk*> soundEffects;
-
50 std::map<std::string, Mix_Music*> music;
-
51};
+
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};
AssetManager
Definition AssetManager.h:21
+
AssetManager::calculateSpawnPosition
Vector2D calculateSpawnPosition(Vector2D size, Vector2D spawnArea)
Calculates a random spawn position for an object within a given area.
Definition AssetManager.cpp:78
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Manager
Is responsible for managing all entities.
Definition Manager.h:23
Vector2D
Definition Vector2D.h:7
diff --git a/CollisionHandler_8cpp__incl.svg b/CollisionHandler_8cpp__incl.svg index fa23d77..96f380d 100644 --- a/CollisionHandler_8cpp__incl.svg +++ b/CollisionHandler_8cpp__incl.svg @@ -1,7 +1,7 @@ - diff --git a/CollisionHandler_8cpp__incl_org.svg b/CollisionHandler_8cpp__incl_org.svg index 07dbd91..35794d5 100644 --- a/CollisionHandler_8cpp__incl_org.svg +++ b/CollisionHandler_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - - - - diff --git a/CollisionHandler_8h__incl_org.svg b/CollisionHandler_8h__incl_org.svg index 4017fe6..7a59739 100644 --- a/CollisionHandler_8h__incl_org.svg +++ b/CollisionHandler_8h__incl_org.svg @@ -1,7 +1,7 @@ - - diff --git a/TransformComponent_8cpp__incl_org.svg b/TransformComponent_8cpp__incl_org.svg index 8fcc602..4176df0 100644 --- a/TransformComponent_8cpp__incl_org.svg +++ b/TransformComponent_8cpp__incl_org.svg @@ -1,7 +1,7 @@ - addSoundEffect(std::string id, const char *path) (defined in AssetManager)AssetManager addTexture(std::string id, const char *path) (defined in AssetManager)AssetManager AssetManager(Manager *manager) (defined in AssetManager)AssetManager - calculateSpawnPosition() (defined in AssetManager)AssetManager - calculateType() (defined in AssetManager)AssetManager + calculateRandomType(int amount) (defined in AssetManager)AssetManager + calculateSpawnPosition(Vector2D size, Vector2D spawnArea)AssetManager createPowerup(Vector2D pos, std::function< void(Entity *)> pickupFunc, std::string texturePath) (defined in AssetManager)AssetManager createProjectile(Vector2D pos, Vector2D velocity, int scale, int range, int speed, const char *texturePath, Entity *owner) (defined in AssetManager)AssetManager getMusic(std::string id) (defined in AssetManager)AssetManager diff --git a/classAssetManager.html b/classAssetManager.html index 01f6372..5fdf426 100644 --- a/classAssetManager.html +++ b/classAssetManager.html @@ -137,12 +137,13 @@ void createProjectile void createPowerup (Vector2D pos, std::function< void(Entity *)> pickupFunc, std::string texturePath)   - -Vector2D calculateSpawnPosition () -  - -PowerupType calculateType () -  +Vector2D calculateSpawnPosition (Vector2D size, Vector2D spawnArea) + Calculates a random spawn position for an object within a given area.
+  + +template<typename T > +T calculateRandomType (int amount) +  void addTexture (std::string id, const char *path)   @@ -162,6 +163,38 @@ Mix_Chunk * getSound ( Mix_Music * getMusic (std::string id)   +

Member Function Documentation

+ +

◆ calculateSpawnPosition()

+ +
+
+ + + + + + + + + + + +
Vector2D AssetManager::calculateSpawnPosition (Vector2D size,
Vector2D spawnArea )
+
+ +

Calculates a random spawn position for an object within a given area.

+
Parameters
+ + + +
sizeThe size (collision box) of the object
spawnAreaThe area within which a spawn position will be calculated
+
+
+
Returns
Spawn Coordinates for the object
+ +
+

The documentation for this class was generated from the following files: +

- c -

+ +

- d -

+

- c -

+ +

- d -