prime/include/Kyoto/Audio/CSfxHandle.hpp
Henrique Gemignani Passos Lima 8cac11d25d Match CScriptSpecialFunction::DeleteEmitter
Former-commit-id: e48f6478f9013986c63a1e78fffb6ea91ba72288
2022-10-03 18:59:07 +03:00

26 lines
624 B
C++

#ifndef _CSFXHANDLE_HPP
#define _CSFXHANDLE_HPP
#include "types.h"
class CSfxHandle {
public:
CSfxHandle() : mID(0) {}
CSfxHandle(uint value);
uint GetIndex() const { return mID & 0xFFF; }
static CSfxHandle NullHandle() { return CSfxHandle(); }
void operator=(const CSfxHandle& other) { mID = other.mID; }
bool operator==(const CSfxHandle& other) { return mID == other.mID; }
bool operator!=(const CSfxHandle& other) { return mID != other.mID; }
operator bool() const { return mID != 0; }
void Clear() { mID = 0; }
private:
uint mID;
static uint mRefCount;
};
CHECK_SIZEOF(CSfxHandle, 0x4)
#endif