C# Класс PlayerIndexMap, GameProject

Maintains a map pairing each player's names to their StatIndex, to allow players to reconnect to games
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddPlayer ( string name ) : int

adds the given player to the map. if they are already in the map, nothing will happen, and their id will be returned. If they're not already in the map, an id will be assigned to the player, and it will be returned.

Clear ( ) : void

clears the map

ContainsPlayer ( string name ) : bool

returns true if the given player has been assigned an id

GetIndexForPlayer ( string name ) : int

returns the id of the given player

GetPlayerNameForIndex ( int index ) : string
PlayerIndexMap ( ) : System.Collections.Generic
this ( string name ) : int

same as GetIndexForPlayer

Описание методов

AddPlayer() публичный Метод

adds the given player to the map. if they are already in the map, nothing will happen, and their id will be returned. If they're not already in the map, an id will be assigned to the player, and it will be returned.
public AddPlayer ( string name ) : int
name string the player to add
Результат int

Clear() публичный Метод

clears the map
public Clear ( ) : void
Результат void

ContainsPlayer() публичный Метод

returns true if the given player has been assigned an id
public ContainsPlayer ( string name ) : bool
name string
Результат bool

GetIndexForPlayer() публичный Метод

returns the id of the given player
public GetIndexForPlayer ( string name ) : int
name string
Результат int

GetPlayerNameForIndex() публичный Метод

public GetPlayerNameForIndex ( int index ) : string
index int
Результат string

PlayerIndexMap() публичный Метод

public PlayerIndexMap ( ) : System.Collections.Generic
Результат System.Collections.Generic

this() публичный Метод

same as GetIndexForPlayer
public this ( string name ) : int
name string
Результат int