27 Player(
int slot, int64_t steamId, std::string connectName, std::string ip,
EntitySystem* entities)
30 _connectName(std::move(connectName)),
33 _connectTime(
Time::Now())
40 int Slot() const noexcept {
return _slot; }
41 int64_t
SteamId() const noexcept {
return _steamId; }
45 bool IsBot() const noexcept {
return _steamId == 0; }
52 PlayerRef Ref() const noexcept {
return {.Slot = _slot, .SteamId = _steamId}; }
56 std::string
Name()
const;
60 std::string_view
Ip() const noexcept {
return _ip; }
63 std::chrono::seconds
Playtime()
const {
return std::chrono::seconds{
Time::Now() - _connectTime}; }
74 std::string _connectName;
A player's identity behind a slot: name, money, team, scoreboard row. It survives death and respawn; ...
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Player(int slot, int64_t steamId, std::string connectName, std::string ip, EntitySystem *entities)
std::string_view Ip() const noexcept
std::chrono::seconds Playtime() const
int64_t SteamId() const noexcept
Player & operator=(const Player &)=delete
int Slot() const noexcept
bool IsBot() const noexcept
Player(const Player &)=delete
VoltMod::Pawn Pawn() const
PlayerRef Ref() const noexcept
VoltMod::Controller Controller() const
A storable reference to a player: the slot plus the SteamID that occupied it.