mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-07 03:25:10 +00:00
add map for SoundSystem and fix error in MusicComponent
This commit is contained in:
@@ -7,20 +7,16 @@
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
MusicComponent::MusicComponent(WAL::Entity &entity, std::string &musicPath)
|
||||
MusicComponent::MusicComponent(WAL::Entity &entity, const std::string &musicPath)
|
||||
: WAL::Component(entity),
|
||||
_musicPath(musicPath),
|
||||
_music(RAY::Audio::Music(musicPath))
|
||||
{
|
||||
}
|
||||
|
||||
MusicComponent::MusicComponent(WAL::Entity &entity)
|
||||
: Component(entity),
|
||||
_music()
|
||||
{}
|
||||
|
||||
WAL::Component *MusicComponent::clone(WAL::Entity &entity) const
|
||||
{
|
||||
return new MusicComponent(entity);
|
||||
return new MusicComponent(entity, this->_musicPath);
|
||||
}
|
||||
|
||||
void MusicComponent::loadMusic(void)
|
||||
|
||||
@@ -35,20 +35,19 @@ namespace BBM
|
||||
//! @inherit
|
||||
WAL::Component *clone(WAL::Entity &entity) const override;
|
||||
//! @brief Create a new MusicComponent at a certain Music
|
||||
MusicComponent(WAL::Entity &entity, std::string &musicPath);
|
||||
explicit MusicComponent(WAL::Entity &entity, const std::string &musicPath);
|
||||
//! @brief A Music component is copy constructable
|
||||
MusicComponent(const MusicComponent &) = default;
|
||||
//! @brief A default destructor
|
||||
~MusicComponent() override = default;
|
||||
//! @brief A Music component is not assignable
|
||||
MusicComponent &operator=(const MusicComponent &) = delete;
|
||||
|
||||
private:
|
||||
//! @brief music of this entity
|
||||
RAY::Audio::Music _music;
|
||||
//! @brief Create a new MusicComponent linked to a specific entity
|
||||
explicit MusicComponent(WAL::Entity &entity);
|
||||
|
||||
|
||||
//! @brief patht to the music assets
|
||||
const std::string _musicPath;
|
||||
};
|
||||
|
||||
} // namespace BBM
|
||||
Reference in New Issue
Block a user