C# Class BattleShip.Core.GameHost

Show file Open project: pebblecode/HackShips Class Usage Examples

Public Methods

Method Description
CreateGame ( string gameName, string initiatingPlayerName, string initiatingPlayerEmail, string acceptingPlayerName, string acceptingPlayerEmail ) : System.Guid
GetNextPlayerEmail ( System.Guid gameId ) : string
GetOpponentTargetZone ( System.Guid gameId, string requestPlayerEmail ) : TargetZone
SetPlayerLocation ( System.Guid gameId, string playerEmail, GeoCoordinate location ) : void
TakeShot ( System.Guid gameId, string playerTakingShotEmail, GeoCoordinate shotLocation ) : ShotResult

Private Methods

Method Description
FindGame ( System.Guid gameId ) : Game
FindGameAndPlayer ( System.Guid gameId, string playerEmail, Player &player ) : Game
FindOpponentByPlayerEmail ( Game game, string playerEmail ) : Player
FindPlayerByEmail ( Game game, string playerEmail ) : Player

Method Details

CreateGame() public method

public CreateGame ( string gameName, string initiatingPlayerName, string initiatingPlayerEmail, string acceptingPlayerName, string acceptingPlayerEmail ) : System.Guid
gameName string
initiatingPlayerName string
initiatingPlayerEmail string
acceptingPlayerName string
acceptingPlayerEmail string
return System.Guid

GetNextPlayerEmail() public method

public GetNextPlayerEmail ( System.Guid gameId ) : string
gameId System.Guid
return string

GetOpponentTargetZone() public method

public GetOpponentTargetZone ( System.Guid gameId, string requestPlayerEmail ) : TargetZone
gameId System.Guid
requestPlayerEmail string
return TargetZone

SetPlayerLocation() public method

public SetPlayerLocation ( System.Guid gameId, string playerEmail, GeoCoordinate location ) : void
gameId System.Guid
playerEmail string
location GeoCoordinate
return void

TakeShot() public method

public TakeShot ( System.Guid gameId, string playerTakingShotEmail, GeoCoordinate shotLocation ) : ShotResult
gameId System.Guid
playerTakingShotEmail string
shotLocation GeoCoordinate
return ShotResult