Liberi
An exergame built for kids with CP!
Minigame Class Reference

Class for general minigame management. More...

Inherits MonoBehaviour.

Public Member Functions

delegate void LocalPlayerAssignedHandler (MinigamePlayer localPlayer)
 
MinigamePlayer GetPlayer (string playerId)
 Get the minigame player with the given player index. More...
 
MinigamePlayer GetPlayer (int peerIndex)
 Get the minigame player with the given peer index. More...
 
MinigamePlayer GetPlayer (GameObject avatar)
 Get the minigame player with the given avatar. More...
 
MinigamePlayer GetPlayer (Component component)
 Get the minigame player with the given avatar. More...
 
T[] GetPlayerAvatarComponents< T > ()
 Gets an array containing the components of type T on all player avatars (humans and bots). More...
 
T[] GetHumanAvatarComponents< T > ()
 Gets an array containing the components of type T on all human player avatars. More...
 
T[] GetBotAvatarComponents< T > ()
 Gets an array containing the components of type T on all bot player avatars. More...
 
MinigameTeam GetTeam (string teamId)
 Get the minigame team with the given ID. More...
 
void RequestPlayerAssign (string teamId)
 Requests a team assignment for the local player. More...
 
void RequestPlayerUnassign ()
 Requests a team unassignment for the local player. More...
 
GameObject AssignPlayer (MinigamePlayer player, string teamId)
 Assign a player's team. More...
 
void UnassignPlayer (MinigamePlayer player)
 Unassigns a minigame player from its current team. This will also despawn its avatar. More...
 
MinigamePlayer AddBotPlayer (string teamId=null)
 Adds a new bot player to the minigame. More...
 
void RemoveBotPlayer (MinigamePlayer player)
 Removes a bot player from the minigame. This will unassign the bot first. More...
 
void Shutdown ()
 Begin the minigame shutdown sequence. See ShutdownAsync. More...
 

Public Attributes

MinigameTeam[] Teams
 All available teams in this minigame. More...
 

Static Public Attributes

static float ShutdownDelay = 2f
 The amount of delay between initiating a server shutdown operation and the server process actually terminatiing. More...
 

Properties

static Minigame Instance [get]
 Gets the sole instance of this minigame. More...
 
MinigameTeam DefaultTeam [get]
 Gets the default team of this minigame. This is simply the first available team. More...
 
MinigamePlayer[] Players [get]
 Gets an array containing all players in this minigame (humans and bots). More...
 
MinigamePlayer[] HumanPlayers [get]
 Gets an array containing all human players in this minigame. More...
 
MinigamePlayer[] BotPlayers [get]
 Gets an array containing all bot players in this minigame. More...
 
GameObject[] PlayerAvatars [get]
 Gets an array containing the avatars for all players in this minigame (humans and bots). More...
 
GameObject[] HumanAvatars [get]
 Gets an array containing the avatars for all human players in this minigame. More...
 
GameObject[] BotAvatars [get]
 Gets an array containing the avatars for all bot players in this minigame. More...
 
int NumPlayers [get]
 Gets the number of players in this minigame (humans and bots). More...
 
int NumHumanPlayers [get]
 Gets the number of human players in this minigame. More...
 
int NumBotPlayers [get]
 Gets the number of bot players in this minigame. More...
 
int[] HumanPlayerPeerIndices [get]
 Gets an array containing the peer indices of all human players in this minigame. More...
 
string[] HumanPlayerIDs [get]
 Gets an array containing the player IDs of all human players in this minigame. More...
 
PlayerProfile[] HumanPlayerProfiles [get]
 Gets an array containing the profiles of all human players in this minigame. More...
 
string[] HumanPlayerNicknames [get]
 Gets an array containing the nicknames of all human players in this minigame. More...
 
int MaxPlayers [get]
 Gets the maximum player capacity of this minigame. More...
 
bool IsFull [get]
 Gets whether or not this minigame is full of players (humans and bots). More...
 
bool IsFullOfHumans [get]
 Gets whether or not this minigame is full of human players. More...
 
MinigamePlayer LocalPlayer [get]
 If this is a game client, returns the local player. More...
 
GameObject LocalAvatar [get]
 If this is a game client, returns the avatar of the local player. More...
 
String ServerTime [get]
 

Events

LocalPlayerAssignedHandler LocalPlayerAssigned = delegate {}
 

Detailed Description

Class for general minigame management.

Definition at line 12 of file Minigame.cs.

Member Function Documentation

MinigamePlayer Minigame.AddBotPlayer ( string  teamId = null)
inline

Adds a new bot player to the minigame.

Parameters
teamIdAn optional team ID for the bot to join. If not provided, or null, bot joins default team.
Returns
The new minigame bot player.

Definition at line 496 of file Minigame.cs.

GameObject Minigame.AssignPlayer ( MinigamePlayer  player,
string  teamId 
)
inline

Assign a player's team.

Parameters
playerThe player to assign.
teamIdThe ID of the team to which the player is to be assigned.
Returns
The avatar which results from the team assignment.

Call this on the server only.

Definition at line 405 of file Minigame.cs.

T [] Minigame.GetBotAvatarComponents< T > ( )
inline

Gets an array containing the components of type T on all bot player avatars.

Type Constraints
T :Component 

Definition at line 354 of file Minigame.cs.

T [] Minigame.GetHumanAvatarComponents< T > ( )
inline

Gets an array containing the components of type T on all human player avatars.

Type Constraints
T :Component 

Definition at line 346 of file Minigame.cs.

MinigamePlayer Minigame.GetPlayer ( string  playerId)
inline

Get the minigame player with the given player index.

Will always return a human player, if any.

Definition at line 277 of file Minigame.cs.

MinigamePlayer Minigame.GetPlayer ( int  peerIndex)
inline

Get the minigame player with the given peer index.

Will always return a human player, if any.

Definition at line 291 of file Minigame.cs.

MinigamePlayer Minigame.GetPlayer ( GameObject  avatar)
inline

Get the minigame player with the given avatar.

Definition at line 304 of file Minigame.cs.

MinigamePlayer Minigame.GetPlayer ( Component  component)
inline

Get the minigame player with the given avatar.

Definition at line 321 of file Minigame.cs.

T [] Minigame.GetPlayerAvatarComponents< T > ( )
inline

Gets an array containing the components of type T on all player avatars (humans and bots).

Type Constraints
T :Component 

Definition at line 338 of file Minigame.cs.

MinigameTeam Minigame.GetTeam ( string  teamId)
inline

Get the minigame team with the given ID.

Definition at line 362 of file Minigame.cs.

void Minigame.RemoveBotPlayer ( MinigamePlayer  player)
inline

Removes a bot player from the minigame. This will unassign the bot first.

Definition at line 527 of file Minigame.cs.

void Minigame.RequestPlayerAssign ( string  teamId)
inline

Requests a team assignment for the local player.

Parameters
teamIdThe ID of the team that the local player would like to join.

Call this on a client.

Definition at line 377 of file Minigame.cs.

void Minigame.RequestPlayerUnassign ( )
inline

Requests a team unassignment for the local player.

Call this on a client.

Definition at line 393 of file Minigame.cs.

void Minigame.Shutdown ( )
inline

Begin the minigame shutdown sequence. See ShutdownAsync.

Definition at line 552 of file Minigame.cs.

void Minigame.UnassignPlayer ( MinigamePlayer  player)
inline

Unassigns a minigame player from its current team. This will also despawn its avatar.

Definition at line 471 of file Minigame.cs.

Member Data Documentation

float Minigame.ShutdownDelay = 2f
static

The amount of delay between initiating a server shutdown operation and the server process actually terminatiing.

Definition at line 204 of file Minigame.cs.

MinigameTeam [] Minigame.Teams
Initial value:
= new MinigameTeam[]
{
}

All available teams in this minigame.

Definition at line 211 of file Minigame.cs.

Property Documentation

GameObject [] Minigame.BotAvatars
get

Gets an array containing the avatars for all bot players in this minigame.

Definition at line 95 of file Minigame.cs.

MinigamePlayer [] Minigame.BotPlayers
get

Gets an array containing all bot players in this minigame.

Definition at line 71 of file Minigame.cs.

MinigameTeam Minigame.DefaultTeam
get

Gets the default team of this minigame. This is simply the first available team.

Definition at line 42 of file Minigame.cs.

GameObject [] Minigame.HumanAvatars
get

Gets an array containing the avatars for all human players in this minigame.

Definition at line 87 of file Minigame.cs.

string [] Minigame.HumanPlayerIDs
get

Gets an array containing the player IDs of all human players in this minigame.

Definition at line 135 of file Minigame.cs.

string [] Minigame.HumanPlayerNicknames
get

Gets an array containing the nicknames of all human players in this minigame.

Definition at line 151 of file Minigame.cs.

int [] Minigame.HumanPlayerPeerIndices
get

Gets an array containing the peer indices of all human players in this minigame.

Definition at line 127 of file Minigame.cs.

PlayerProfile [] Minigame.HumanPlayerProfiles
get

Gets an array containing the profiles of all human players in this minigame.

Definition at line 143 of file Minigame.cs.

MinigamePlayer [] Minigame.HumanPlayers
get

Gets an array containing all human players in this minigame.

Definition at line 63 of file Minigame.cs.

Minigame Minigame.Instance
staticget

Gets the sole instance of this minigame.

Definition at line 30 of file Minigame.cs.

bool Minigame.IsFull
get

Gets whether or not this minigame is full of players (humans and bots).

Definition at line 167 of file Minigame.cs.

bool Minigame.IsFullOfHumans
get

Gets whether or not this minigame is full of human players.

Definition at line 175 of file Minigame.cs.

GameObject Minigame.LocalAvatar
get

If this is a game client, returns the avatar of the local player.

Definition at line 191 of file Minigame.cs.

MinigamePlayer Minigame.LocalPlayer
get

If this is a game client, returns the local player.

Definition at line 183 of file Minigame.cs.

int Minigame.MaxPlayers
get

Gets the maximum player capacity of this minigame.

Definition at line 159 of file Minigame.cs.

int Minigame.NumBotPlayers
get

Gets the number of bot players in this minigame.

Definition at line 119 of file Minigame.cs.

int Minigame.NumHumanPlayers
get

Gets the number of human players in this minigame.

Definition at line 111 of file Minigame.cs.

int Minigame.NumPlayers
get

Gets the number of players in this minigame (humans and bots).

Definition at line 103 of file Minigame.cs.

GameObject [] Minigame.PlayerAvatars
get

Gets an array containing the avatars for all players in this minigame (humans and bots).

Definition at line 79 of file Minigame.cs.

MinigamePlayer [] Minigame.Players
get

Gets an array containing all players in this minigame (humans and bots).

Definition at line 55 of file Minigame.cs.


The documentation for this class was generated from the following file: