mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 21:23: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);
|
||||
|
||||
Vector2D calculateSpawnPosition();
|
||||
PowerupType calculateType();
|
||||
template <typename T> T calculateType(int amount);
|
||||
|
||||
//texture management
|
||||
void addTexture(std::string id, const char* path);
|
||||
|
||||
@ -98,8 +98,9 @@ Vector2D AssetManager::calculateSpawnPosition()
|
||||
return spawnPos;
|
||||
}
|
||||
|
||||
PowerupType AssetManager::calculateType()
|
||||
template <typename T>
|
||||
T AssetManager::calculateType(int amount)
|
||||
{
|
||||
PowerupType type = PowerupType(rand() % 3);
|
||||
return type;
|
||||
T type = T(rand() % amount);
|
||||
return type;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user