KisaragiLibrary
 
読み取り中…
検索中…
一致する文字列を見つけられません
Kisaragi_Lib::SoundPlayerComponent クラス

Facadeクラスのcontainerに対するインターフェースとなるクラス [詳解]

#include <Sound.hpp>

Kisaragi_Lib::SoundPlayerComponent の継承関係図
Kisaragi_Lib::ComponentBase

公開メンバ関数

 SoundPlayerComponent ()
 
SoundClipoperator[] (std::string _key)
 
void Add (std::string _key, std::string _soundFile, std::string _clipName)
 
void Add (std::string _key, std::string _clipName)
 
void Pop (std::string _clipName)
 
 ~SoundPlayerComponent ()
 
- 基底クラス Kisaragi_Lib::ComponentBase に属する継承公開メンバ関数
void GameObj (GameObjBase *_obj)
 
GameObjBaseGameObj ()
 
string ID () const
 
void ID (string _id)
 
virtual ComponentBaseGetThisComponent ()
 
virtual void Start ()
 
virtual ~ComponentBase ()
 

非公開変数類

std::unordered_map< std::string, std::unique_ptr< SoundClip > > vec
 

その他の継承メンバ

- 基底クラス Kisaragi_Lib::ComponentBase に属する継承限定公開変数類
string id
 
string name
 
GameObjBasegameObj
 

詳解

Facadeクラスのcontainerに対するインターフェースとなるクラス

構築子と解体子

◆ SoundPlayerComponent()

Kisaragi_Lib::SoundPlayerComponent::SoundPlayerComponent ( )
158 {
160 }
static void Init()
Definition Sound.cpp:41

◆ ~SoundPlayerComponent()

Kisaragi_Lib::SoundPlayerComponent::~SoundPlayerComponent ( )
inline
184 {
185 while (vec.size()!=0)
186 {
187 Pop(vec.begin()->first);
188 }
189 }
std::unordered_map< std::string, std::unique_ptr< SoundClip > > vec
Definition Sound.hpp:161
void Pop(std::string _clipName)
Definition Sound.cpp:173

関数詳解

◆ operator[]()

SoundClip & Kisaragi_Lib::SoundPlayerComponent::operator[] ( std::string _key)
inline
168 {
169 if (!vec.count(_key))
170 {
171 Debug::PrintAssertStatic("keyの要素が存在しません");
172 }
173 return *vec[_key];
174 }
static void PrintAssertStatic(const std::string _in)
エラー出力用コンソール出力(文字色しか変わらない)
Definition Debug.cpp:152

◆ Add() [1/2]

void Kisaragi_Lib::SoundPlayerComponent::Add ( std::string _key,
std::string _soundFile,
std::string _clipName )
163 {
164 SoundResourceFacade::Load(_key, _soundFile);
165 vec.emplace(_clipName, SoundResourceFacade::CreateClip(_key));
166 }
static std::unique_ptr< SoundClip > CreateClip(std::string _key)
Definition Sound.cpp:150
static void Load(std::string _key, std::string _pass)
Definition Sound.cpp:138

◆ Add() [2/2]

void Kisaragi_Lib::SoundPlayerComponent::Add ( std::string _key,
std::string _clipName )
169 {
170 vec.emplace(_clipName, SoundResourceFacade::CreateClip(_key));
171 }

◆ Pop()

void Kisaragi_Lib::SoundPlayerComponent::Pop ( std::string _clipName)
174 {
175 // まず削除を行う
176 auto clip = std::move(vec[_clipName]);
177 vec.erase(_clipName);
178
179 // その後で所有権を移動
181 }
static void Push(std::unique_ptr< SoundClip > _clip)
Definition Sound.cpp:46

参照元 ~SoundPlayerComponent().

メンバ詳解

◆ vec

std::unordered_map<std::string,std::unique_ptr<SoundClip> > Kisaragi_Lib::SoundPlayerComponent::vec
private

このクラス詳解は次のファイルから抽出されました: