C# Class Mooege.Core.GS.Games.Game

Inheritance: IMessageConsumer
Show file Open project: xsochor/mooege Class Usage Examples

Public Properties

Property Type Description
PlayerIndexCounter int
TickRate int
UpdateFrequency int

Public Methods

Method Description
AddWorld ( Mooege.Core.GS.Map.World world ) : void
Consume ( Mooege.Net.GS.GameClient client, GameMessage message ) : void
EndTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : void
Enter ( Player joinedPlayer ) : void

Allows a player to join the game.

Game ( int gameId ) : System

Creates a new game with given gameId.

GetObject ( uint dynamicID ) : Mooege.Core.GS.Objects.DynamicObject
GetWorld ( int worldSNO ) : Mooege.Core.GS.Map.World
IsTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : bool
IsTracking ( uint dynamicID ) : bool
RemoveWorld ( Mooege.Core.GS.Map.World world ) : void
Route ( Mooege.Net.GS.GameClient client, GameMessage message ) : void

Routers incoming GameMessage to it's proper consumer.

StartTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : void
Update ( ) : void

The main game loop.

WorldExists ( int worldSNO ) : bool

Private Methods

Method Description
SendNewPlayerMessage ( Player target, Player joinedPlayer ) : void

Sends NewPlayerMessage to players when a new player joins the game.

Method Details

AddWorld() public method

public AddWorld ( Mooege.Core.GS.Map.World world ) : void
world Mooege.Core.GS.Map.World
return void

Consume() public method

public Consume ( Mooege.Net.GS.GameClient client, GameMessage message ) : void
client Mooege.Net.GS.GameClient
message GameMessage
return void

EndTracking() public method

public EndTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : void
obj Mooege.Core.GS.Objects.DynamicObject
return void

Enter() public method

Allows a player to join the game.
public Enter ( Player joinedPlayer ) : void
joinedPlayer Player The new player.
return void

Game() public method

Creates a new game with given gameId.
public Game ( int gameId ) : System
gameId int
return System

GetObject() public method

public GetObject ( uint dynamicID ) : Mooege.Core.GS.Objects.DynamicObject
dynamicID uint
return Mooege.Core.GS.Objects.DynamicObject

GetWorld() public method

public GetWorld ( int worldSNO ) : Mooege.Core.GS.Map.World
worldSNO int
return Mooege.Core.GS.Map.World

IsTracking() public method

public IsTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : bool
obj Mooege.Core.GS.Objects.DynamicObject
return bool

IsTracking() public method

public IsTracking ( uint dynamicID ) : bool
dynamicID uint
return bool

RemoveWorld() public method

public RemoveWorld ( Mooege.Core.GS.Map.World world ) : void
world Mooege.Core.GS.Map.World
return void

Route() public method

Routers incoming GameMessage to it's proper consumer.
public Route ( Mooege.Net.GS.GameClient client, GameMessage message ) : void
client Mooege.Net.GS.GameClient
message GameMessage
return void

StartTracking() public method

public StartTracking ( Mooege.Core.GS.Objects.DynamicObject obj ) : void
obj Mooege.Core.GS.Objects.DynamicObject
return void

Update() public method

The main game loop.
public Update ( ) : void
return void

WorldExists() public method

public WorldExists ( int worldSNO ) : bool
worldSNO int
return bool

Property Details

PlayerIndexCounter public property

Player index counter.
public int PlayerIndexCounter
return int

TickRate public property

Incremented tick value on each Game.Update().
public int TickRate
return int

UpdateFrequency public property

Update frequency for the game - 100 ms.
public int UpdateFrequency
return int