C# 클래스 MBC.Core.Game.Match

파일 보기 프로젝트 열기: aiclub/Mohawk_Battleship 1 사용 예제들

공개 메소드들

메소드 설명
AddPlayer ( Player plr ) : bool

Adds a player to the match.

AddTeam ( Team newTeam ) : bool

Adds a team to the match.

Match ( Configuration config ) : System

Creates a match with parameters loaded from a configuration.

Play ( ) : void

Moves the match progress forward at a standard pace.

PlayerDisqualified ( Player plr, string reason ) : bool

Signals a disqualification event against a player for a specific reason.

PlayerLost ( Player plr ) : bool

Marks a player as a loser in the current round and increases their losing score. Player must be active in order to lose, otherwise this method returns false.

PlayerSetShips ( Player plr, IList ships ) : bool

Sets the ships that are assigned to a player.

PlayerShot ( Player plr, Shot shot ) : bool

Use when a player shoots.

PlayerShot ( Player plr, Shot shot, Ship shipHit ) : bool

Use when a player shoots and hits a ship.

PlayerTeamAssign ( Player plr, Team newTeam ) : bool

Assign a player to a team.

PlayerTimeout ( Player plr, ControllerTimeoutException ex ) : void

Call when a player has timed out.

PlayerWin ( Player plr ) : void

Call when a player has won a round.

RemovePlayer ( Player plr ) : bool

Call when a player is to be removed from the match.

RemoveTeam ( Team remTeam ) : bool

Call when a team is to be removed from the match.

ShipsValid ( Player player ) : bool

Checks if a player's ship are placed, and are valid within the parameters of the match.

Stop ( ) : void

Stops progression of the match.

보호된 메소드들

메소드 설명
IsShotValid ( Shot shot ) : bool

Determines whether or not a given shot is valid within the parameters of the match.

PlayLogic ( ) : bool
PlayerMessage ( Player plr, string msg ) : void

Call when a player is outputting a message.

PlayerShipDestroyed ( Player plr, Ship destroyedShip ) : void

Call when a ship from a player has been destroyed.

SetParameters ( Configuration conf ) : void

Changes the match parameters to reflect the configuration given.

비공개 메소드들

메소드 설명
AppendEvent ( MBC.Core.Events.Event ev ) : void

Appends an event to the list of events of the match, with a proper timestamp.

ApplyParameters ( Configuration conf ) : void

Applies a configuration to the match.

EndRound ( ) : void

Notifies the end of a round.

MatchEnd ( ) : bool

Called when the match ends.

NewRound ( ) : void

Notifies a new round beginning.

NotifyParamsChanged ( ) : void

Notifies match parameter changes.

메소드 상세

AddPlayer() 공개 메소드

Adds a player to the match.
public AddPlayer ( Player plr ) : bool
plr Player
리턴 bool

AddTeam() 공개 메소드

Adds a team to the match.
public AddTeam ( Team newTeam ) : bool
newTeam Team
리턴 bool

IsShotValid() 보호된 메소드

Determines whether or not a given shot is valid within the parameters of the match.
protected IsShotValid ( Shot shot ) : bool
shot Shot
리턴 bool

Match() 공개 메소드

Creates a match with parameters loaded from a configuration.
public Match ( Configuration config ) : System
config Configuration
리턴 System

Play() 공개 메소드

Moves the match progress forward at a standard pace.
public Play ( ) : void
리턴 void

PlayLogic() 보호된 메소드

protected PlayLogic ( ) : bool
리턴 bool

PlayerDisqualified() 공개 메소드

Signals a disqualification event against a player for a specific reason.
public PlayerDisqualified ( Player plr, string reason ) : bool
plr Player
reason string
리턴 bool

PlayerLost() 공개 메소드

Marks a player as a loser in the current round and increases their losing score. Player must be active in order to lose, otherwise this method returns false.
public PlayerLost ( Player plr ) : bool
plr Player
리턴 bool

PlayerMessage() 보호된 메소드

Call when a player is outputting a message.
protected PlayerMessage ( Player plr, string msg ) : void
plr Player
msg string
리턴 void

PlayerSetShips() 공개 메소드

Sets the ships that are assigned to a player.
public PlayerSetShips ( Player plr, IList ships ) : bool
plr Player
ships IList
리턴 bool

PlayerShipDestroyed() 보호된 메소드

Call when a ship from a player has been destroyed.
protected PlayerShipDestroyed ( Player plr, Ship destroyedShip ) : void
plr Player
destroyedShip Ship
리턴 void

PlayerShot() 공개 메소드

Use when a player shoots.
public PlayerShot ( Player plr, Shot shot ) : bool
plr Player
shot Shot
리턴 bool

PlayerShot() 공개 메소드

Use when a player shoots and hits a ship.
public PlayerShot ( Player plr, Shot shot, Ship shipHit ) : bool
plr Player
shot Shot
shipHit Ship
리턴 bool

PlayerTeamAssign() 공개 메소드

Assign a player to a team.
public PlayerTeamAssign ( Player plr, Team newTeam ) : bool
plr Player
newTeam Team
리턴 bool

PlayerTimeout() 공개 메소드

Call when a player has timed out.
public PlayerTimeout ( Player plr, ControllerTimeoutException ex ) : void
plr Player
ex MBC.Core.Threading.ControllerTimeoutException
리턴 void

PlayerWin() 공개 메소드

Call when a player has won a round.
public PlayerWin ( Player plr ) : void
plr Player
리턴 void

RemovePlayer() 공개 메소드

Call when a player is to be removed from the match.
public RemovePlayer ( Player plr ) : bool
plr Player
리턴 bool

RemoveTeam() 공개 메소드

Call when a team is to be removed from the match.
public RemoveTeam ( Team remTeam ) : bool
remTeam Team
리턴 bool

SetParameters() 보호된 메소드

Changes the match parameters to reflect the configuration given.
protected SetParameters ( Configuration conf ) : void
conf Configuration
리턴 void

ShipsValid() 공개 메소드

Checks if a player's ship are placed, and are valid within the parameters of the match.
public ShipsValid ( Player player ) : bool
player Player
리턴 bool

Stop() 공개 메소드

Stops progression of the match.
public Stop ( ) : void
리턴 void