C# Class MBC.Core.Game.UserMatch

A one-round match that uses the standard rules of battleship with a User verus a Bot.
Inheritance: MatchCore
Exibir arquivo Open project: aiclub/Mohawk_Battleship Class Usage Examples

Public Methods

Method Description
AddUser ( Player user ) : void

To set the User as a player of the match.

ComputerTurn ( ) : void

Computer begins their turn.

Play ( ) : void

Starts a one round match.

Restart ( ) : void

To restart the match.

UserMatch ( Configuration conf ) : System

Constructs a match with a specific configuration.

UserShoot ( Shot shot ) : void

Starts the Users turn, shots and ends the turn.

Protected Methods

Method Description
PlayLogic ( ) : bool

Private Methods

Method Description
HandleAddPlayer ( Event ev ) : void
HandleEndTurn ( Event ev ) : void
HandleRoundBegin ( Event ev ) : void
HandleShipDestroyed ( Event ev ) : void
HandleShipMove ( Event ev ) : void
HandleShot ( Event ev ) : void
HandleWinner ( Event ev ) : void

Method Details

AddUser() public method

To set the User as a player of the match.
public AddUser ( Player user ) : void
user MBC.Shared.Entities.Player User controller
return void

ComputerTurn() public method

Computer begins their turn.
public ComputerTurn ( ) : void
return void

Play() public method

Starts a one round match.
public Play ( ) : void
return void

PlayLogic() protected method

protected PlayLogic ( ) : bool
return bool

Restart() public method

To restart the match.
public Restart ( ) : void
return void

UserMatch() public method

Constructs a match with a specific configuration.
public UserMatch ( Configuration conf ) : System
conf Configuration Configuration Information
return System

UserShoot() public method

Starts the Users turn, shots and ends the turn.
public UserShoot ( Shot shot ) : void
shot Shot
return void