2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CSFXHANDLE
|
|
|
|
#define _CSFXHANDLE
|
2022-08-15 04:51:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
class CSfxHandle {
|
|
|
|
public:
|
2022-09-30 00:24:12 +00:00
|
|
|
CSfxHandle() : mID(0) {}
|
2022-09-16 03:24:27 +00:00
|
|
|
CSfxHandle(uint value);
|
2022-08-15 04:51:06 +00:00
|
|
|
|
2022-09-16 03:24:27 +00:00
|
|
|
uint GetIndex() const { return mID & 0xFFF; }
|
2022-09-16 03:37:46 +00:00
|
|
|
static CSfxHandle NullHandle() { return CSfxHandle(); }
|
|
|
|
void operator=(const CSfxHandle& other) { mID = other.mID; }
|
2022-09-16 03:24:27 +00:00
|
|
|
bool operator==(const CSfxHandle& other) { return mID == other.mID; }
|
|
|
|
bool operator!=(const CSfxHandle& other) { return mID != other.mID; }
|
|
|
|
operator bool() const { return mID != 0; }
|
2022-10-03 15:59:07 +00:00
|
|
|
void Clear() { mID = 0; }
|
2022-08-15 04:51:06 +00:00
|
|
|
|
|
|
|
private:
|
2022-09-16 03:24:27 +00:00
|
|
|
uint mID;
|
|
|
|
static uint mRefCount;
|
2022-08-15 04:51:06 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CSfxHandle, 0x4)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CSFXHANDLE
|