mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 13:43:41 +00:00
rework calculateType()
This commit is contained in:
parent
c19171328d
commit
1cd604e1f0
@ -28,7 +28,7 @@ public:
|
|||||||
void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, std::string texturePath);
|
void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, std::string texturePath);
|
||||||
|
|
||||||
Vector2D calculateSpawnPosition();
|
Vector2D calculateSpawnPosition();
|
||||||
PowerupType calculateType();
|
template <typename T> T calculateType(int amount);
|
||||||
|
|
||||||
//texture management
|
//texture management
|
||||||
void addTexture(std::string id, const char* path);
|
void addTexture(std::string id, const char* path);
|
||||||
|
|||||||
@ -98,8 +98,9 @@ Vector2D AssetManager::calculateSpawnPosition()
|
|||||||
return spawnPos;
|
return spawnPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerupType AssetManager::calculateType()
|
template <typename T>
|
||||||
|
T AssetManager::calculateType(int amount)
|
||||||
{
|
{
|
||||||
PowerupType type = PowerupType(rand() % 3);
|
T type = T(rand() % amount);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user