C# Class EtherDuels.Game.Model.GameModel

The GameModel is responsible for updating the logic of the game repeatedly.
显示文件 Open project: julius/pse_spacewar Class Usage Examples

Public Methods

Method Description
GameModel ( ShortLifespanObjectFactory factory, Physics physics, List players, World world ) : System

Creates a new GameModel object.

GetFactory ( ) : ShortLifespanObjectFactory

Returns the assigned ShortLifespanObjectFactory.

RemovePlayer ( Player player ) : void

Removes the assigned player from the list of players.

Update ( FrameState frameState ) : void

Updates the physics and all players.

Method Details

GameModel() public method

Creates a new GameModel object.
public GameModel ( ShortLifespanObjectFactory factory, Physics physics, List players, World world ) : System
factory ShortLifespanObjectFactory The assigned ShortLifespanObjectFactory to create new WorldObjects.
physics Physics The assigned Physics to calculate new positions.
players List An array of all participating players.
world World The assigned World.
return System

GetFactory() public method

Returns the assigned ShortLifespanObjectFactory.
public GetFactory ( ) : ShortLifespanObjectFactory
return ShortLifespanObjectFactory

RemovePlayer() public method

Removes the assigned player from the list of players.
public RemovePlayer ( Player player ) : void
player Player The player which has to be removed.
return void

Update() public method

Updates the physics and all players.
public Update ( FrameState frameState ) : void
frameState FrameState A state object which contains how much time has passed since the last update.
return void