Player teams.
More...
#include <CaveNet_ExportedTypes.h>
|
enum | TeamType { TEAM_YELLOW = 0
, TEAM_GREEN = 1
, TEAM_RED = 2
, TEAM_BLUE = 3
} |
|
|
void | Link () |
| Link this team to the rest.
|
|
void | Unlink () |
| Unlink this team from the rest.
|
|
|
class | NetClient |
|
class | NetPlayer |
|
◆ AddMember()
bool CaveNet::DataStructures::NetTeam::AddMember |
( |
NetClient * |
pClient, |
|
|
bool |
bAnnounce = true |
|
) |
| |
Add a client to this team.
- Parameters
-
pClient | The client to add. |
bAnnounce | Whether to announce the client's join or not. |
- Returns
- Returns true on success, false otherwise.
◆ AddSpawnPoint()
bool CaveNet::DataStructures::NetTeam::AddSpawnPoint |
( |
int |
iNpcIdx | ) |
|
Add a spawn point to this team.
- Parameters
-
iNpcIdx | The index of the NPC in gNPC. |
- Returns
- Returns true on success, false otherwise.
◆ AreTeamsUnbalanced()
static bool CaveNet::DataStructures::NetTeam::AreTeamsUnbalanced |
( |
NetTeamId & |
iHighestTeam, |
|
|
NetTeamId & |
iLightestTeam |
|
) |
| |
|
static |
Check to see if teams are unbalanced.
- Parameters
-
iHighestTeam | A reference to an int that will store the heaviest team's ID. |
iHighestTeam | A reference to an int that will store the lightest team's ID. |
- Returns
- Returns true if teams are unbalanced, false otherwise.
◆ BalanceTeams()
static void CaveNet::DataStructures::NetTeam::BalanceTeams |
( |
bool |
bOnlySwitchDeadPlayers = false | ) |
|
|
static |
Autobalance teams.
- Parameters
-
bOnlySwitchDeadPlayers | Only switch dead players. |
◆ FindTeamById()
static NetTeam* CaveNet::DataStructures::NetTeam::FindTeamById |
( |
NetTeamId |
iTeamId, |
|
|
bool |
bClientSide |
|
) |
| |
|
static |
Find a team by id.
- Parameters
-
iTeamId | The ID of the team we want to find. |
bClientSide | Whether to search the client-sided array or the server-sided array. |
- Returns
- Returns the team if it exists, NULL otherwise.
◆ FindTeamByName()
static NetTeam* CaveNet::DataStructures::NetTeam::FindTeamByName |
( |
const char * |
pName, |
|
|
bool |
bClientSide |
|
) |
| |
|
static |
Find a team by name.
- Parameters
-
pName | The name of the team we want to find. |
bClientSide | Whether to search the client-sided array or the server-sided array. |
- Returns
- Returns the team if it exists, NULL otherwise.
◆ FindTeamByType()
static NetTeam* CaveNet::DataStructures::NetTeam::FindTeamByType |
( |
TeamType |
iTeamType, |
|
|
bool |
bClientSide |
|
) |
| |
|
static |
Find a team by type.
- Parameters
-
iTeamType | The type of the team we want to find. |
bClientSide | Whether to search the client-sided array or the server-sided array. |
- Returns
- Returns the team if it exists, NULL otherwise.
◆ GetColor()
GUI_COLOR CaveNet::DataStructures::NetTeam::GetColor |
( |
| ) |
|
|
inline |
Get this team's color.
- Returns
- Returns this team's color.
◆ GetHexColor()
const char* CaveNet::DataStructures::NetTeam::GetHexColor |
( |
| ) |
|
|
inline |
Get this team's color in hexidecimal.
- Returns
- Returns this team's color in hexidecimal format.
◆ GetMember()
NetClient* CaveNet::DataStructures::NetTeam::GetMember |
( |
int |
iIndex | ) |
|
Get a member of this team.
- Parameters
-
iIndex | The index of the member. |
- Returns
- Returns a pointer to a NetClient* on success, else returns NULL if index is out of bounds.
◆ GetMemberCount()
int CaveNet::DataStructures::NetTeam::GetMemberCount |
( |
| ) |
|
Get this team's member count.
- Returns
- Returns this team's member count.
◆ GetName()
const char* CaveNet::DataStructures::NetTeam::GetName |
( |
| ) |
|
|
inline |
Get this team's name.
- Returns
- Returns this team's color.
◆ GetNextFreeTeamId()
static NetTeamId CaveNet::DataStructures::NetTeam::GetNextFreeTeamId |
( |
bool |
bClientSide | ) |
|
|
static |
Get the next free team ID.
- Parameters
-
bClientSide | Whether to reference the client-side array or the server-side array. |
- Returns
- Returns the next free Team ID.
◆ GetNpcSpawnIndex()
int CaveNet::DataStructures::NetTeam::GetNpcSpawnIndex |
( |
| ) |
|
|
inline |
Get the spawn index.
- Returns
- Returns the spawn npc index.
◆ GetSpawnPosition()
GUI_POINT CaveNet::DataStructures::NetTeam::GetSpawnPosition |
( |
| ) |
|
Get the spawn position for this team.
- Returns
- Returns a spawn position.
◆ GetTeamByIndex()
static NetTeam* CaveNet::DataStructures::NetTeam::GetTeamByIndex |
( |
int |
iTeamIndex, |
|
|
bool |
bClientSide |
|
) |
| |
|
static |
Fetch a team by index.
- Parameters
-
iTeamIndex | The index of the team to get. |
bClientSide | Whether to search the client-sided array or the server-sided array. |
- Returns
- Returns the team if it exists, NULL otherwise.
◆ GetTeamId()
NetTeamId CaveNet::DataStructures::NetTeam::GetTeamId |
( |
| ) |
|
|
inline |
Get this team's ID.
- Returns
- Returns this team's ID.
◆ IsClientSide()
bool CaveNet::DataStructures::NetTeam::IsClientSide |
( |
| ) |
|
|
inline |
Get whether this team is client-sided or not.
- Returns
- Returns true if this team exists client-side, false if it exists server-side.
◆ IsMember()
bool CaveNet::DataStructures::NetTeam::IsMember |
( |
NetClient * |
pClient | ) |
|
Check if a client is a member of this team.
- Parameters
-
pClient | The client to check. |
- Returns
- Returns true if the given client is apart of this team.
◆ OpenTeamEditMenu()
static int CaveNet::DataStructures::NetTeam::OpenTeamEditMenu |
( |
NetTeam * |
pTeam = NULL | ) |
|
|
static |
Opens an easy-to-use dialog that will allow the host to add or edit a team.
- Parameters
-
pTeam | The team to edit. If NULL, a new team will be created. |
- Returns
- Returns the resulting error code.
◆ OpenTeamListMenu()
static int CaveNet::DataStructures::NetTeam::OpenTeamListMenu |
( |
| ) |
|
|
static |
Opens an easy-to-use dialog that will allow the host to go through teams.
- Returns
- Returns the resulting error code.
◆ ReadPacket()
void CaveNet::DataStructures::NetTeam::ReadPacket |
( |
NetPacket * |
pPacket | ) |
|
Read a team packet.
- Parameters
-
pPacket | The packet to read from. |
◆ RemoveMember()
bool CaveNet::DataStructures::NetTeam::RemoveMember |
( |
NetClient * |
pClient, |
|
|
bool |
bAnnounce = true |
|
) |
| |
Remove a member for this team.
- Parameters
-
pClient | The client to remove. |
bAnnounce | Whether to announce the client's departure or not. |
- Returns
- Returns true on success, false otherwise.
◆ SetColor()
void CaveNet::DataStructures::NetTeam::SetColor |
( |
GUI_COLOR |
pColor | ) |
|
Set the team's color.
- Parameters
-
pColor | The new team color. |
◆ SetName()
void CaveNet::DataStructures::NetTeam::SetName |
( |
const char * |
pNewName | ) |
|
Set the team's name.
- Parameters
-
pNewName | The new team name. |
◆ SetNpcSpawnIndex()
void CaveNet::DataStructures::NetTeam::SetNpcSpawnIndex |
( |
int |
iIndex | ) |
|
Set the NPC spawn index.
- Parameters
-
iIndex | The index of the spawn NPC. |
◆ SizePacket()
unsigned int CaveNet::DataStructures::NetTeam::SizePacket |
( |
| ) |
|
Size up a team packet.
- Returns
- Returns the size of the packet, in bits.
◆ SpawnClient()
void CaveNet::DataStructures::NetTeam::SpawnClient |
( |
NetClient * |
pClient | ) |
|
Spawn a player.
- Parameters
-
pClient | The team member to spawn. |
◆ WritePacket()
void CaveNet::DataStructures::NetTeam::WritePacket |
( |
NetPacket * |
pPacket | ) |
|
Write a team packet.
- Parameters
-
pPacket | The packet to write to. |
◆ mTeamId
NetTeamId CaveNet::DataStructures::NetTeam::mTeamId |
|
protected |
The team net ID.
This is sent over the network instead of the team name (if we can help it).
The documentation for this class was generated from the following file: