Add few QoL methods to CPlayerSlot

This commit is contained in:
GAMMACASE 2025-11-28 19:04:30 +03:00
parent 20ae6c37f6
commit d27464d9cd

View File

@ -5,24 +5,19 @@
#pragma once
#endif
#include "const.h"
class CPlayerSlot
{
public:
CPlayerSlot(int slot) : m_Data(slot)
{
}
CPlayerSlot( int slot ) : m_Data( slot ) {}
int Get() const
{
return m_Data;
}
void Invalidate() { m_Data = -1; }
bool IsValid() const { return m_Data >= 0 && m_Data < ABSOLUTE_PLAYER_LIMIT; }
int Get() const { return 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;
}
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:
int m_Data;