Arcade
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
GameAPI.GameBase Class Referenceabstract

Base class for all arcade games. More...

Inheritance diagram for GameAPI.GameBase:
GameAPI.Sandboxing.Remotable GameAPI.IGame GameAPI.Sandboxing.IRemotable GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware > GameAPI.BudgetBoy.Game

Classes

class  AttachToCabinetCall
 
class  BeginUpdateCall
 
class  CapturePauseFrameCall
 
class  CapturePauseFrameResponse
 
class  EndUpdateCall
 
class  GetGameInfoCall
 
class  GetGameInfoResponse
 
class  GetGraphicsInfoCall
 
class  GetGraphicsInfoResponse
 
class  InitializeCall
 
class  InitializeResourceLibraryCall
 
class  InitializeResourceLibraryResponse
 
class  LoadResourcesCall
 
class  LoadStateCall
 
class  PauseCall
 
class  Proxy
 
class  ResetCall
 
class  ResumeCall
 
class  SaveStateCall
 
class  SaveStateResponse
 

Public Member Functions

delegate void LoadGameAsyncCallback (IGame game)
 
void PushPreUpdate (Action action)
 
void Reset ()
 Manually unpauses and resets the game. More...
 
void RenderPausedFrame ()
 Renders the last frame shown before the game became paused. More...
 
- Public Member Functions inherited from GameAPI.Sandboxing.Remotable
void Dispose ()
 

Static Public Member Functions

static void RegisterAPIAssembly (Assembly asm)
 
static void FromAssemblyAsync (string path, string[] refPaths, Sandbox sandbox, LoadGameAsyncCallback callback)
 
static IGame FromAssembly (string path, string[] refPaths, Sandbox sandbox)
 
static void FromCSSourcesAsync (string baseDir, Sandbox sandbox, LoadGameAsyncCallback callback)
 
static IGame FromCSSources (string baseDir, Sandbox sandbox)
 
static void FromPackageAsync< TCabinet > (Sandbox sandbox, Stream stream, TCabinet cabinet, LoadGameAsyncCallback callback)
 
static IGame FromPackage< TCabinet > (Sandbox sandbox, Stream stream, TCabinet cabinet=null)
 

Public Attributes

const int SavedStateSizeLimit = 65535
 Maximum size of a game save state, in bytes. More...
 

Protected Member Functions

virtual void OnRegisterResourceTypes (ResourceManager library)
 Used to register custom resource types to be used by the game. More...
 
virtual void OnInitialize ()
 Called when the game is about to start. More...
 
virtual void OnLoadResources (Resources volume)
 Called when game resources are available to be loaded. More...
 
virtual void OnPause ()
 Called when the game is paused. More...
 
virtual void OnReset ()
 Called when the game resets and first begins. More...
 
virtual void OnResume ()
 Called when the game is resumed from a paused state. More...
 
virtual void OnUpdate ()
 Called at regular intervals, specified by UpdateRate, just before a frame is drawn. More...
 
virtual void OnRender ()
 Called at regular intervals, specified by UpdateRate, when a frame is being drawn. More...
 
virtual void OnRenderPauseScreen (double timeUntilReset)
 Called in the place of OnRender() when the game is paused, with timeUntilReset in seconds. More...
 
virtual void OnSaveState (BinaryWriter writer)
 Allows game state to be transferred between players so that they can pass control to each other when overridden along with OnLoadState(). More...
 
virtual void OnLoadState (BinaryReader reader)
 Allows game state to be transferred between players so that they can pass control to each other when overridden along with OnSaveState(). More...
 
- Protected Member Functions inherited from GameAPI.Sandboxing.Remotable
virtual void OnDispose ()
 

Properties

IGameInfo GameInfo [get]
 Gets a structure containing general information about the game. More...
 
IGraphicsInfo GraphicsInfo [get]
 Gets a structure containing information about the graphical specifications of the game. More...
 
int UpdateRate [get]
 Gets the number of times this game updates per second. More...
 
TimeSpan TimeStep [get]
 Gets the period between game updates in seconds. More...
 
bool IsPaused [get]
 If true, the game is in a paused state and is not updating. More...
 
ulong Tick [get, set]
 Gets the number of updates since the game first began. More...
 
double Time [get]
 Gets the estimated number of seconds since the game first began. More...
 
abstract int LastFrameSize [get]
 Gets the number of bytes needed to stream the previous frame. More...
 
bool CanTransferState [get]
 If true, this game has implemented game state transmission between clients. More...
 
bool ResetWhenChangePlayer [get]
 If true, this game hasn't implemented game state transmission and so must reset when changing player. More...
 
- Properties inherited from GameAPI.IGame
bool IsPaused [get]
 
IGameInfo GameInfo [get]
 
IGraphicsInfo GraphicsInfo [get]
 

Events

EventHandler Paused
 
EventHandler Restarted
 
EventHandler Resumed
 
- Events inherited from GameAPI.IGame
EventHandler Restarted
 

Detailed Description

Base class for all arcade games.

Member Function Documentation

static IGame GameAPI.GameBase.FromAssembly ( string  path,
string[]  refPaths,
Sandbox  sandbox 
)
inlinestatic
static void GameAPI.GameBase.FromAssemblyAsync ( string  path,
string[]  refPaths,
Sandbox  sandbox,
LoadGameAsyncCallback  callback 
)
inlinestatic
static IGame GameAPI.GameBase.FromCSSources ( string  baseDir,
Sandbox  sandbox 
)
inlinestatic
static void GameAPI.GameBase.FromCSSourcesAsync ( string  baseDir,
Sandbox  sandbox,
LoadGameAsyncCallback  callback 
)
inlinestatic
static IGame GameAPI.GameBase.FromPackage< TCabinet > ( Sandbox  sandbox,
Stream  stream,
TCabinet  cabinet = null 
)
inlinestatic
Type Constraints
TCabinet :class 
TCabinet :ICabinet 
static void GameAPI.GameBase.FromPackageAsync< TCabinet > ( Sandbox  sandbox,
Stream  stream,
TCabinet  cabinet,
LoadGameAsyncCallback  callback 
)
inlinestatic
Type Constraints
TCabinet :class 
TCabinet :ICabinet 
delegate void GameAPI.GameBase.LoadGameAsyncCallback ( IGame  game)
virtual void GameAPI.GameBase.OnInitialize ( )
inlineprotectedvirtual

Called when the game is about to start.

virtual void GameAPI.GameBase.OnLoadResources ( Resources  volume)
inlineprotectedvirtual

Called when game resources are available to be loaded.

virtual void GameAPI.GameBase.OnLoadState ( BinaryReader  reader)
inlineprotectedvirtual

Allows game state to be transferred between players so that they can pass control to each other when overridden along with OnSaveState().

Parameters
readerBinaryReader to read game state from.
virtual void GameAPI.GameBase.OnPause ( )
inlineprotectedvirtual

Called when the game is paused.

virtual void GameAPI.GameBase.OnRegisterResourceTypes ( ResourceManager  library)
inlineprotectedvirtual

Used to register custom resource types to be used by the game.

Parameters
libraryResource archive library to register custom resource types to.
virtual void GameAPI.GameBase.OnRender ( )
inlineprotectedvirtual

Called at regular intervals, specified by UpdateRate, when a frame is being drawn.

Reimplemented in GameAPI.BudgetBoy.Game.

virtual void GameAPI.GameBase.OnRenderPauseScreen ( double  timeUntilReset)
inlineprotectedvirtual

Called in the place of OnRender() when the game is paused, with timeUntilReset in seconds.

Reimplemented in GameAPI.BudgetBoy.Game.

virtual void GameAPI.GameBase.OnReset ( )
inlineprotectedvirtual

Called when the game resets and first begins.

virtual void GameAPI.GameBase.OnResume ( )
inlineprotectedvirtual

Called when the game is resumed from a paused state.

virtual void GameAPI.GameBase.OnSaveState ( BinaryWriter  writer)
inlineprotectedvirtual

Allows game state to be transferred between players so that they can pass control to each other when overridden along with OnLoadState().

Parameters
writerBinaryWriter to write game state to.
virtual void GameAPI.GameBase.OnUpdate ( )
inlineprotectedvirtual

Called at regular intervals, specified by UpdateRate, just before a frame is drawn.

Reimplemented in GameAPI.BudgetBoy.Game.

void GameAPI.GameBase.PushPreUpdate ( Action  action)
inline

Implements GameAPI.IGame.

static void GameAPI.GameBase.RegisterAPIAssembly ( Assembly  asm)
inlinestatic
void GameAPI.GameBase.RenderPausedFrame ( )
inline

Renders the last frame shown before the game became paused.

void GameAPI.GameBase.Reset ( )
inline

Manually unpauses and resets the game.

Implements GameAPI.IGame.

Member Data Documentation

const int GameAPI.GameBase.SavedStateSizeLimit = 65535

Maximum size of a game save state, in bytes.

Property Documentation

bool GameAPI.GameBase.CanTransferState
get

If true, this game has implemented game state transmission between clients.

IGameInfo GameAPI.GameBase.GameInfo
get

Gets a structure containing general information about the game.

IGraphicsInfo GameAPI.GameBase.GraphicsInfo
get

Gets a structure containing information about the graphical specifications of the game.

bool GameAPI.GameBase.IsPaused
get

If true, the game is in a paused state and is not updating.

abstract int GameAPI.GameBase.LastFrameSize
get

Gets the number of bytes needed to stream the previous frame.

bool GameAPI.GameBase.ResetWhenChangePlayer
get

If true, this game hasn't implemented game state transmission and so must reset when changing player.

ulong GameAPI.GameBase.Tick
getset

Gets the number of updates since the game first began.

double GameAPI.GameBase.Time
get

Gets the estimated number of seconds since the game first began.

TimeSpan GameAPI.GameBase.TimeStep
get

Gets the period between game updates in seconds.

int GameAPI.GameBase.UpdateRate
get

Gets the number of times this game updates per second.

Event Documentation

EventHandler GameAPI.GameBase.Paused
EventHandler GameAPI.GameBase.Restarted
EventHandler GameAPI.GameBase.Resumed