with Events;
with Values; use Values;
pragma Elaborate_All( Events );
package Events.Game is
type End_Game_Event is new Event with private;
type A_End_Game_Event is access all End_Game_Event'Class;
END_GAME_ID : constant Event_Id := To_Event_Id( "End_Game" );
type Game_Paused_Event is new Event with private;
type A_Game_Paused_Event is access all Game_Paused_Event'Class;
GAME_PAUSED_ID : constant Event_Id := To_Event_Id( "Game_Paused" );
function Is_Paused( this : not null access Game_Paused_Event'Class ) return Boolean;
type Game_State_Event is new Event with private;
type A_Game_State_Event is access all Game_State_Event'Class;
GAME_STATE_ID : constant Event_Id := To_Event_Id( "Game_State" );
function Is_Playing( this : not null access Game_State_Event'Class ) return Boolean;
type Game_Var_Changed_Event is new Event with private;
type A_Game_Var_Changed_Event is access all Game_Var_Changed_Event'Class;
GAME_VAR_CHANGED_ID : constant Event_Id := To_Event_Id( "Game_Var_Changed" );
function Get_Var( this : not null access Game_Var_Changed_Event'Class ) return String;
procedure Copy_Value( this : access Game_Var_Changed_Event;
val : in out A_Value );
pragma Precondition( val = null );
type Loading_Event is new Event with private;
type A_Loading_Event is access all Loading_Event'Class;
LOADING_ID : constant Event_Id := To_Event_Id( "Loading" );
function Is_Loading( this : not null access Loading_Event'Class ) return Boolean;
type New_Game_Event is new Event with private;
type A_New_Game_Event is access all New_Game_Event'Class;
NEW_GAME_ID : constant Event_Id := To_Event_Id( "New_Game" );
type Pause_Game_Event is new Event with private;
type A_Pause_Game_Event is access all Pause_Game_Event'Class;
PAUSE_GAME_ID : constant Event_Id := To_Event_Id( "Pause_Game" );
function Is_Paused( this : not null access Pause_Game_Event'Class ) return Boolean;
type Player_Died_Event is new Event with private;
type A_Player_Died_Event is access all Player_Died_Event'Class;
PLAYER_DIED_ID : constant Event_Id := To_Event_Id( "Player_Died" );
type Scroll_View_Event is new Event with private;
type A_Scroll_View_Event is access all Scroll_View_Event'Class;
SCROLL_VIEW_ID : constant Event_Id := To_Event_Id( "Scroll_View" );
function Get_X( this : not null access Scroll_View_Event'Class ) return Float;
function Get_Y( this : not null access Scroll_View_Event'Class ) return Float;
type View_Ready_Event is new Event with private;
type A_View_Ready_Event is access all View_Ready_Event'Class;
VIEW_READY_ID : constant Event_Id := To_Event_Id( "View_Ready" );
function Is_Ready( this : not null access View_Ready_Event'Class ) return Boolean;
procedure Queue_End_Game;
procedure Queue_Game_Paused( paused : Boolean );
procedure Queue_Game_State( playing : Boolean );
procedure Queue_Game_Var_Changed( var : String;
val : in out A_Value );
pragma Precondition( var'Length > 0 );
pragma Postcondition( val = null );
procedure Queue_Loading( loading : Boolean );
procedure Queue_New_Game;
procedure Queue_Pause_Game( paused : Boolean );
procedure Queue_Player_Died;
procedure Queue_Scroll_View( x, y : Float );
procedure Queue_View_Ready( ready : Boolean );
private
type End_Game_Event is new Event with null record;
type Game_Paused_Event is new Event with
record
paused : Boolean := True;
end record;
procedure Construct( this : access Game_Paused_Event; paused : Boolean );
function To_String( this : access Game_Paused_Event ) return String;
type Game_State_Event is new Event with
record
playing : Boolean := True;
end record;
procedure Construct( this : access Game_State_Event; playing : Boolean );
function To_String( this : access Game_State_Event ) return String;
type Game_Var_Changed_Event is new Event with
record
var : Unbounded_String;
val : A_Value := null;
end record;
procedure Adjust( this : access Game_Var_Changed_Event );
procedure Construct( this : access Game_Var_Changed_Event;
var : String;
val : in out A_Value );
pragma Precondition( var'Length > 0 );
pragma Postcondition( val = null );
procedure Delete( this : in out Game_Var_Changed_Event );
function To_String( this : access Game_Var_Changed_Event ) return String;
type Loading_Event is new Event with
record
loading : Boolean;
end record;
procedure Construct( this : access Loading_Event; loading : Boolean );
function To_String( this : access Loading_Event ) return String;
type New_Game_Event is new Event with null record;
type Pause_Game_Event is new Event with
record
paused : Boolean := True;
end record;
procedure Construct( this : access Pause_Game_Event; paused : Boolean );
type Player_Died_Event is new Event with null record;
type Scroll_View_Event is new Event with
record
x, y : Float := 0.0;
end record;
procedure Construct( this : access Scroll_View_Event; x, y : Float );
type View_Ready_Event is new Event with
record
ready : Boolean := True;
end record;
procedure Construct( this : access View_Ready_Event; ready : Boolean );
end Events.Game;