Method | Description | |
---|---|---|
GameLoop ( string opponent, int width, int height, List |
Main battleship game loop
|
|
Seed ( string opponent ) : void |
Method | Description | |
---|---|---|
Accept ( string s ) : CommandResult |
Handles the 'accept' command
|
|
Exit ( string s ) : CommandResult |
Handles the 'exit' command
|
|
Fire ( string s ) : CommandResult |
Handles the 'fire' command - sends out the next shot
|
|
GetEnemyPositions ( ) : void |
When a win/loss/tie command is received, it is followed with a list of enemy positions - read these
|
|
Hit ( string s ) : CommandResult |
Handles the 'hit' command - records last coordinates shot at as a hit
|
|
Incoming ( string s ) : CommandResult |
Handles the 'incoming' command
|
|
Loss ( string s ) : CommandResult |
Handles the 'loss' command
|
|
Miss ( string s ) : CommandResult |
Handles the 'miss' command - records the last coordinates shot at as a miss
|
|
Reject ( string s ) : CommandResult |
Handles the 'reject' command
|
|
Sink ( string s ) : CommandResult |
Handles the 'sink' command - records a ship as sunk
|
|
Tie ( string s ) : CommandResult |
Handles the 'tie' command
|
|
Win ( string s ) : CommandResult |
Handles the 'win' command
|
public GameLoop ( string opponent, int width, int height, List |
||
opponent | string | Name of opponent |
width | int | Width of board |
height | int | Height of board |
ships | List |
Ships in play |
player | ||
return | void |
public static Seed ( string opponent ) : void | ||
opponent | string | |
return | void |