VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Team.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5namespace VoltMod
6{
7
8/** Engine team indices, as `m_iTeamNum` holds them. SDK-free so command parsing can share them. */
9enum class Team : uint8_t
10{
11 None = 0,
12 Spectator = 1,
13 T = 2,
14 CT = 3,
15};
16
17/** True for the two teams that play a round. */
18constexpr bool IsPlaying(Team team)
19{
20 return team == Team::T || team == Team::CT;
21}
22
23/** The other playing team; @ref Team::None for a team that does not play. */
25{
26 switch (team)
27 {
28 case Team::T:
29 return Team::CT;
30 case Team::CT:
31 return Team::T;
32 default:
33 return Team::None;
34 }
35}
36
37} // namespace VoltMod
constexpr bool IsPlaying(Team team)
Definition Team.hpp:18
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
constexpr Team Opposite(Team team)
Definition Team.hpp:24