C# 클래스 PlayerIndexMap, GameProject

Maintains a map pairing each player's names to their StatIndex, to allow players to reconnect to games
파일 보기 프로젝트 열기: EECS390IndieTeam/GameProject 1 사용 예제들

공개 메소드들

메소드 설명
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