Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
eng::AudioComponent Class Referenceabstract

#include <AudioComponent.h>

+ Inheritance diagram for eng::AudioComponent:
+ Collaboration diagram for eng::AudioComponent:

Public Member Functions

void LoadProperties (const nlohmann::json &json) override
 
void Update (float deltaTime) override
 
void RegisterAudio (const std::string &name, std::shared_ptr< Audio > &clip)
 
void Play (const std::string &name, bool loop=false)
 
void Stop (const std::string &name)
 
bool IsPlaying (const std::string &name)
 
virtual void Init ()
 
virtual size_t GetTypeId () const =0
 
GameObjectGetOwner ()
 

Static Public Member Functions

template<typename T >
static size_t StaticTypeId ()
 

Protected Attributes

GameObjectm_owner = nullptr
 

Detailed Description

Definition at line 7 of file AudioComponent.h.

Member Function Documentation

◆ GetOwner()

GameObject * eng::Component::GetOwner ( )
inherited

Definition at line 15 of file Component.cpp.

References eng::Component::m_owner.

Referenced by eng::MeshComponent::Update(), and eng::SpriteComponent::Update().

◆ GetTypeId()

virtual size_t eng::Component::GetTypeId ( ) const
pure virtualinherited

◆ Init()

void eng::Component::Init ( )
virtualinherited

Reimplemented in eng::PhysicsComponent, and eng::PlayerControllerComponent.

Definition at line 11 of file Component.cpp.

Referenced by eng::GameObject::AddComponent().

◆ IsPlaying()

bool eng::AudioComponent::IsPlaying ( const std::string &  name)

Definition at line 67 of file AudioComponent.cpp.

Referenced by Player::Update().

◆ LoadProperties()

void eng::AudioComponent::LoadProperties ( const nlohmann::json &  json)
overridevirtual

Reimplemented from eng::Component.

Definition at line 6 of file AudioComponent.cpp.

References eng::Audio::Load(), and RegisterAudio().

◆ Play()

void eng::AudioComponent::Play ( const std::string &  name,
bool  loop = false 
)

Definition at line 43 of file AudioComponent.cpp.

Referenced by Player::Update().

◆ RegisterAudio()

void eng::AudioComponent::RegisterAudio ( const std::string &  name,
std::shared_ptr< Audio > &  clip 
)

Definition at line 38 of file AudioComponent.cpp.

Referenced by LoadProperties().

◆ StaticTypeId()

template<typename T >
static size_t eng::Component::StaticTypeId ( )
inlinestaticinherited

Definition at line 26 of file Component.h.

◆ Stop()

void eng::AudioComponent::Stop ( const std::string &  name)

Definition at line 55 of file AudioComponent.cpp.

Referenced by Player::Update().

◆ Update()

void eng::AudioComponent::Update ( float  deltaTime)
overridevirtual

Implements eng::Component.

Definition at line 26 of file AudioComponent.cpp.

References eng::GameObject::GetWorldPosition(), and eng::Component::m_owner.

Member Data Documentation

◆ m_owner


The documentation for this class was generated from the following files: