with Events;
with Values; use Values;
pragma Elaborate_All( Events );
package Events.Game is
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_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 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;
procedure Queue_Game_Paused( paused : 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_Scroll_View( x, y : Float );
private
type Game_Paused_Event is new Event with
record
paused : Boolean := True;
end record;
procedure Construct( this : access Game_Paused_Event; paused : Boolean );
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 );
type Loading_Event is new Event with
record
loading : Boolean;
end record;
procedure Construct( this : access Loading_Event; loading : Boolean );
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 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 );
end Events.Game;