prime/include/Kyoto/Audio/CSfxHandle.hpp
Phillip Stephens 6a56b467d7 Match and link CMidiManager
Former-commit-id: 6544d347a623a29d670c4f923da1aea09e16bf3a
2023-10-26 12:50:31 -07:00

26 lines
654 B
C++

#ifndef _CSFXHANDLE
#define _CSFXHANDLE
#include "types.h"
class CSfxHandle {
public:
CSfxHandle() : mID(0) {}
CSfxHandle(uint value);
int GetIndex() const { return mID & 0xFFF; }
static CSfxHandle NullHandle() { return CSfxHandle(); }
void operator=(const CSfxHandle& other) { mID = other.mID; }
const bool operator==(const CSfxHandle& other) const { return mID == other.mID; }
const bool operator!=(const CSfxHandle& other) const { 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 // _CSFXHANDLE