mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-12-06 18:18:23 +00:00
Add few QoL methods to CPlayerSlot
This commit is contained in:
parent
20ae6c37f6
commit
d27464d9cd
@ -5,24 +5,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "const.h"
|
||||||
|
|
||||||
class CPlayerSlot
|
class CPlayerSlot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CPlayerSlot(int slot) : m_Data(slot)
|
CPlayerSlot( int slot ) : m_Data( slot ) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int Get() const
|
void Invalidate() { m_Data = -1; }
|
||||||
{
|
bool IsValid() const { return m_Data >= 0 && m_Data < ABSOLUTE_PLAYER_LIMIT; }
|
||||||
return m_Data;
|
int Get() const { return m_Data; }
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(const CPlayerSlot &other) const {
|
bool operator==( const CPlayerSlot &other ) const { return other.m_Data == m_Data; }
|
||||||
return other.m_Data == m_Data;
|
bool operator!=( const CPlayerSlot &other ) const { return other.m_Data != m_Data; }
|
||||||
}
|
|
||||||
bool operator!=(const CPlayerSlot &other) const {
|
|
||||||
return other.m_Data != m_Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_Data;
|
int m_Data;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user