C# Class WebGame.Game

显示文件 Open project: AdmiralPotato/ggj2013 Class Usage Examples

Public Properties

Property Type Description
DefaultShips Ship>.Dictionary
IsRunning bool
OnEnd Player>.Action
Random System.Random

Private Properties

Property Type Description
ConnectPlayer Player
DisconnectPlayer void
DisconnectPlayer void
GetDefaultShip Ship
timer_Elapsed void

Public Methods

Method Description
Add ( StarSystem starSystem ) : void
DisplayGameStatus ( int accountId, bool isAdmin ) : string
EliminatePlayer ( Player loser ) : void
End ( ) : void
ForceEnd ( ) : void
Game ( ) : System
GenScore ( int place ) : double
GenScoreExpected ( int playerRating, int opponentRating ) : double
GetActivePlayerCount ( ) : int
GetPlayer ( int accountId ) : Player
GetPlayer ( string sessionId ) : Player
GetScoreExpected ( Player player ) : double
Join ( int accountId, string name, int rating ) : Player
Join ( Player player ) : void
Load ( byte data ) : Game
Run ( ) : void
Save ( ) : byte[]
SendForumMessage ( string text, Player source, string sourceName = "Computer" ) : void
Start ( ) : void
StopRunning ( ) : void
Unjoin ( Player player ) : void
Update ( System.TimeSpan elapsed ) : void

Private Methods

Method Description
ConnectPlayer ( string signalrConnectionId, string sessionId ) : Player
DisconnectPlayer ( Player player ) : void
DisconnectPlayer ( string signalrConnectionId, string sessionId ) : void
GetDefaultShip ( int defaultShipNumber, string name = "Heart of the Deep" ) : Ship
timer_Elapsed ( object sender, System e ) : void

Method Details

Add() public method

public Add ( StarSystem starSystem ) : void
starSystem StarSystem
return void

DisplayGameStatus() public method

public DisplayGameStatus ( int accountId, bool isAdmin ) : string
accountId int
isAdmin bool
return string

EliminatePlayer() public method

public EliminatePlayer ( Player loser ) : void
loser Player
return void

End() public method

public End ( ) : void
return void

ForceEnd() public method

public ForceEnd ( ) : void
return void

Game() public method

public Game ( ) : System
return System

GenScore() public method

public GenScore ( int place ) : double
place int
return double

GenScoreExpected() public method

public GenScoreExpected ( int playerRating, int opponentRating ) : double
playerRating int
opponentRating int
return double

GetActivePlayerCount() public method

public GetActivePlayerCount ( ) : int
return int

GetPlayer() public method

public GetPlayer ( int accountId ) : Player
accountId int
return Player

GetPlayer() public method

public GetPlayer ( string sessionId ) : Player
sessionId string
return Player

GetScoreExpected() public method

public GetScoreExpected ( Player player ) : double
player Player
return double

Join() public method

public Join ( int accountId, string name, int rating ) : Player
accountId int
name string
rating int
return Player

Join() public method

public Join ( Player player ) : void
player Player
return void

Load() public static method

public static Load ( byte data ) : Game
data byte
return Game

Run() public method

public Run ( ) : void
return void

Save() public method

public Save ( ) : byte[]
return byte[]

SendForumMessage() public method

public SendForumMessage ( string text, Player source, string sourceName = "Computer" ) : void
text string
source Player
sourceName string
return void

Start() public method

public Start ( ) : void
return void

StopRunning() public method

public StopRunning ( ) : void
return void

Unjoin() public method

public Unjoin ( Player player ) : void
player Player
return void

Update() public method

public Update ( System.TimeSpan elapsed ) : void
elapsed System.TimeSpan
return void

Property Details

DefaultShips public_oe property

public Dictionary DefaultShips
return Ship>.Dictionary

IsRunning public_oe property

public bool IsRunning
return bool

OnEnd public_oe static_oe property

public static Action OnEnd
return Player>.Action

Random public_oe static_oe property

public static Random,System Random
return System.Random