factored out initFx method

refactored creation of explosion FX
This commit is contained in:
devZoGok
2025-06-07 20:49:06 +03:00
parent 2638f9b3a1
commit 5421e6003f
11 changed files with 238 additions and 221 deletions
-6
View File
@@ -177,12 +177,6 @@ namespace battleship{
return within;
}
void GameObject::initSound(){
deathSfxBuffer = new sf::SoundBuffer();
string sfxPath = generateView()[getGameObjTableName()][id + 1]["deathSfx"];
deathSfx = prepareSfx(deathSfxBuffer, sfxPath);
}
string GameObject::getGameObjTableName(){
switch(type){
case GameObject::Type::UNIT: