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
|
|
|
|
2024-10-13 02:30:48 +00:00
|
|
|
int 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; }
|
2023-10-26 19:50:31 +00:00
|
|
|
const bool operator==(const CSfxHandle& other) const { return mID == other.mID; }
|
|
|
|
const bool operator!=(const CSfxHandle& other) const { return mID != other.mID; }
|
2022-09-16 03:24:27 +00:00
|
|
|
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
|