C# Class MBC.Shared.Entities.Player

Inheritance: System.Entity
Exibir arquivo Open project: aiclub/Mohawk_Battleship Class Usage Examples

Public Methods

Method Description
BeginTurn ( ) : void

Begins the player's turn.

Disqualify ( String reason ) : void

Disqualifies the player

EndTurn ( ) : void

Switches the turn from this player to another.

Lose ( ) : void

Makes the player lose

Message ( String message ) : void

Makes the player send a message.

Player ( System.Entity parent, string newName ) : System

Constructs a Player with an ID and a name. This player will not have a controller.

Shoot ( int x, int y ) : Shot

Shoots against an arbitrary player opponent at the specified X and Y coordinates.

Shoot ( Player opponent, int x, int y ) : void

Shoots against a player opponent at the specified X and Y coordinates.

Shoot ( Shot shot ) : void

Shoots a shot for the player.

ToString ( ) : string

Generates a string representation of the player.

Win ( ) : void

Makes the player win.

Method Details

BeginTurn() public method

Begins the player's turn.
public BeginTurn ( ) : void
return void

Disqualify() public method

Disqualifies the player
public Disqualify ( String reason ) : void
reason String
return void

EndTurn() public method

Switches the turn from this player to another.
Thrown when the event being created is not valid for the /// current state of the player.
public EndTurn ( ) : void
return void

Lose() public method

Makes the player lose
Thrown when the event being created is not valid for the /// current state of the player.
public Lose ( ) : void
return void

Message() public method

Makes the player send a message.
public Message ( String message ) : void
message String
return void

Player() public method

Constructs a Player with an ID and a name. This player will not have a controller.
public Player ( System.Entity parent, string newName ) : System
parent System.Entity
newName string The name of the player
return System

Shoot() public method

Shoots against an arbitrary player opponent at the specified X and Y coordinates.
public Shoot ( int x, int y ) : Shot
x int
y int
return Shot

Shoot() public method

Shoots against a player opponent at the specified X and Y coordinates.
public Shoot ( Player opponent, int x, int y ) : void
opponent Player
x int
y int
return void

Shoot() public method

Shoots a shot for the player.
public Shoot ( Shot shot ) : void
shot Shot
return void

ToString() public method

Generates a string representation of the player.
public ToString ( ) : string
return string

Win() public method

Makes the player win.
Thrown when the event being created is not valid for the /// current state of the player.
public Win ( ) : void
return void