remove empty ctor for SoundComponent

This commit is contained in:
TrueBabyChaise
2021-06-08 10:50:42 +02:00
parent 8c380e05b1
commit 473b6d64e8
2 changed files with 4 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
namespace BBM
{
SoundComponent::SoundComponent(WAL::Entity &entity, \
std::map<SoundComponent::soundIndex, std::string> &soundPath)
const std::map<SoundComponent::soundIndex, std::string> &soundPath)
: WAL::Component(entity),
_soundIndex(IDLE),
_soundPath(soundPath)
@@ -24,15 +24,9 @@ std::map<SoundComponent::soundIndex, std::string> &soundPath)
}
}
SoundComponent::SoundComponent(WAL::Entity &entity)
: Component(entity),
_soundList(),
_soundIndex()
{}
WAL::Component *SoundComponent::clone(WAL::Entity &entity) const
{
return new SoundComponent(entity);
return new SoundComponent(entity, this->_soundPath);
}
void SoundComponent::playSound()

View File

@@ -50,7 +50,7 @@ namespace BBM
//! @inherit
WAL::Component *clone(WAL::Entity &entity) const override;
//! @brief Create a new SoundComponent at a certain Sound
SoundComponent(WAL::Entity &entity, std::map<soundIndex, std::string> &);
explicit SoundComponent(WAL::Entity &entity, const std::map<soundIndex, std::string> &);
//! @brief A Sound component is copy constructable
SoundComponent(const SoundComponent &) = default;
//! @brief A default destructor
@@ -63,16 +63,11 @@ namespace BBM
std::map<soundIndex, bool> _isLoad;
std::map<soundIndex, std::string> _soundPath;
const std::map<soundIndex, std::string> _soundPath;
//! SoundIndex
soundIndex _soundIndex;
//! @brief Create a new SoundComponent linked to a specific entity
explicit SoundComponent(WAL::Entity &entity);
};
} // namespace BBM