Arcade
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware > Class Template Reference

Base class for all arcade games, specifying a particular controls, graphics and audio (virtual) hardware implementation. More...

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

Protected Member Functions

override void OnDispose ()
 
- Protected Member Functions inherited from GameAPI.GameBase
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...
 

Properties

TControls Controls [get]
 Access the controls hardware interface for this game instance. More...
 
TGraphics Graphics [get]
 Access the graphics hardware interface for this game instance. More...
 
TAudio Audio [get]
 Access the audio hardware interface for this game instance. More...
 
TFirmware Firmware [get]
 
override int LastFrameSize [get]
 Number of bytes required to stream the previous frame. More...
 
- Properties inherited from GameAPI.GameBase
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]
 

Additional Inherited Members

- Public Member Functions inherited from GameAPI.GameBase
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 inherited from GameAPI.GameBase
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 inherited from GameAPI.GameBase
const int SavedStateSizeLimit = 65535
 Maximum size of a game save state, in bytes. More...
 
- Events inherited from GameAPI.GameBase
EventHandler Paused
 
EventHandler Restarted
 
EventHandler Resumed
 
- Events inherited from GameAPI.IGame
EventHandler Restarted
 

Detailed Description

Base class for all arcade games, specifying a particular controls, graphics and audio (virtual) hardware implementation.

Template Parameters
TControlsHardware interface type for controls.
TGraphicsHardware interface type for graphics.
TAudioHardware interface type for audio.
Type Constraints
TControls :Peripheral 
TControls :IControls 
TGraphics :Peripheral 
TGraphics :IGraphics 
TAudio :Peripheral 
TAudio :IAudio 
TFirmware :Peripheral 
TFirmware :IFirmware 

Member Function Documentation

override void GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.OnDispose ( )
inlineprotectedvirtual

Reimplemented from GameAPI.Sandboxing.Remotable.

Property Documentation

TAudio GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.Audio
get

Access the audio hardware interface for this game instance.

TControls GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.Controls
get

Access the controls hardware interface for this game instance.

TFirmware GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.Firmware
get
TGraphics GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.Graphics
get

Access the graphics hardware interface for this game instance.

override int GameAPI.GameBase< TControls, TGraphics, TAudio, TFirmware >.LastFrameSize
get

Number of bytes required to stream the previous frame.