Index

Package: Games

Description

package Games is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Game (abstract)

type Game is abstract new Limited_Object and Event_Listener with private;

Ancestors:

Primitive operations:

Construct (overriding Objects.Construct)
Delete (overriding Objects.Delete)
Events.Listeners.To_String (Inherited)
Handle_Event (overriding Events.Listeners.Handle_Event)
Objects.To_String (Inherited)
The Game class is parent object in the Game Logic system, which is responsible for managing the game session and all the interactions between entities during gameplay. The Game provides a Process_Manager to run the game logic, a Corral to receive events sent to listeners in the game logic, an association of modifyable game session variables, and game session persistence. The Game object itself is a Process and Event_Listener that is attached to its own Process_Manager and Corral facilities. The Game class also provides a limited interface, Game_State, which allow objects to reference it and access game state information and game session variables without a full view of the Game class, which in some cases would cause circular dependencies or allow unnecessary exposing of information.

Types

A_Game

type A_Game is access all Game'Class;

Subprograms & Entries

Create_Game

function Create_Game return A_Game;
Creates a new Game object using the registered allocator. If no allocator has been registered, an exception will be raised.

Finalize

procedure Finalize
( this: not null access Game'Class );
Finalizes the game logic and detaches it from the framework. This must be called before deleting the object, if it has been initialized.

Get_Corral

function Get_Corral
( this: not null access Game'Class ) return A_Corral;
Returns the Game's event Corral. It is created during Game construction.

Initialize

procedure Initialize
( this: not null access Game'Class );
Initializes the game logic object and attaches it to the framework. Be sure to call Finalize() before deleting the object.

Delete

procedure Delete
( this: in out A_Game );
Deletes the Game object. Finalize() must be called first, if the Game object has been initialized.