14 static std::string
GetType() {
return "AudioEmitter"; };
36 void SetSound(
const std::string& path);
75 int Serialize(std::fstream* data,
int offset)
override;
83 int Deserialize(std::fstream* data,
int offset)
override;
Contains the declaration of the Audio class and related structures.
Defines the GameObject class and its related components.
The AudioEmitter class represents a component that emits audio in a game object.
Definition AudioEmitter.h:8
float frequency
frequency The frequency of the AudioEmitter.
Definition AudioEmitter.h:62
bool isLooping
isLooping Indicates whether the AudioEmitter is looping or not.
Definition AudioEmitter.h:67
GameObject * attachedObj
attachedObj The game object that the AudioEmitter is attached to.
Definition AudioEmitter.h:47
int Deserialize(std::fstream *data, int offset) override
Deserialize deserializes the AudioEmitter data.
Definition AudioEmitter.cpp:52
AudioEmitter()
AudioEmitter constructor.
Definition AudioEmitter.h:19
int Serialize(std::fstream *data, int offset) override
Serialize serializes the AudioEmitter data.
Definition AudioEmitter.cpp:37
Sound * sound
sound The sound object of the AudioEmitter.
Definition AudioEmitter.h:52
~AudioEmitter()
AudioEmitter destructor.
Definition AudioEmitter.cpp:11
int volume
volume The volume of the AudioEmitter. Should be clamped from 0.0 to 1.0.
Definition AudioEmitter.h:57
static std::map< GameObject *, AudioEmitter * > componentList
componentList A map of game objects and their corresponding AudioEmitter components.
Definition AudioEmitter.h:88
void SetSound(const std::string &path)
SetSound sets the sound path for the AudioEmitter.
Definition AudioEmitter.cpp:18
static std::string GetType()
GetType returns the type of the AudioEmitter component.
Definition AudioEmitter.h:14
Base class for game components.
Definition GameObject.h:29
Class representing a game object.
Definition GameObject.h:68
Represents a sound asset.
Definition Audio.h:54