1. with Events; 
  2. with Values;                            use Values; 
  3.  
  4. pragma Elaborate_All( Events ); 
  5.  
  6. package Events.Game is 
  7.  
  8.     type Game_Paused_Event is new Event with private; 
  9.     type A_Game_Paused_Event is access all Game_Paused_Event'Class; 
  10.  
  11.     GAME_PAUSED_ID : constant Event_Id := To_Event_Id( "Game_Paused" ); 
  12.  
  13.     function Is_Paused( this : not null access Game_Paused_Event'Class ) return Boolean; 
  14.  
  15.     ---------------------------------------------------------------------------- 
  16.  
  17.     type Game_Var_Changed_Event is new Event with private; 
  18.     type A_Game_Var_Changed_Event is access all Game_Var_Changed_Event'Class; 
  19.  
  20.     GAME_VAR_CHANGED_ID : constant Event_Id := To_Event_Id( "Game_Var_Changed" ); 
  21.  
  22.     function Get_Var( this : not null access Game_Var_Changed_Event'Class ) return String; 
  23.  
  24.     procedure Copy_Value( this : access Game_Var_Changed_Event; 
  25.                           val  : in out A_Value ); 
  26.     pragma Precondition( val = null ); 
  27.  
  28.     ---------------------------------------------------------------------------- 
  29.  
  30.     type Loading_Event is new Event with private; 
  31.     type A_Loading_Event is access all Loading_Event'Class; 
  32.  
  33.     LOADING_ID : constant Event_Id := To_Event_Id( "Loading" ); 
  34.  
  35.     function Is_Loading( this : not null access Loading_Event'Class ) return Boolean; 
  36.  
  37.     ---------------------------------------------------------------------------- 
  38.  
  39.     type New_Game_Event is new Event with private; 
  40.     type A_New_Game_Event is access all New_Game_Event'Class; 
  41.  
  42.     NEW_GAME_ID : constant Event_Id := To_Event_Id( "New_Game" ); 
  43.  
  44.     ---------------------------------------------------------------------------- 
  45.  
  46.     type Pause_Game_Event is new Event with private; 
  47.     type A_Pause_Game_Event is access all Pause_Game_Event'Class; 
  48.  
  49.     PAUSE_GAME_ID : constant Event_Id := To_Event_Id( "Pause_Game" ); 
  50.  
  51.     function Is_Paused( this : not null access Pause_Game_Event'Class ) return Boolean; 
  52.  
  53.     ---------------------------------------------------------------------------- 
  54.  
  55.     type Scroll_View_Event is new Event with private; 
  56.     type A_Scroll_View_Event is access all Scroll_View_Event'Class; 
  57.  
  58.     SCROLL_VIEW_ID : constant Event_Id := To_Event_Id( "Scroll_View" ); 
  59.  
  60.     -- Amount to scroll view in the X axis in world coordinates. 
  61.     function Get_X( this : not null access Scroll_View_Event'Class ) return Float; 
  62.  
  63.     -- Amount to scroll view in the Y axis in world coordinates. 
  64.     function Get_Y( this : not null access Scroll_View_Event'Class ) return Float; 
  65.  
  66.     ---------------------------------------------------------------------------- 
  67.  
  68.     procedure Queue_Game_Paused( paused : Boolean ); 
  69.  
  70.     procedure Queue_Game_Var_Changed( var : String; 
  71.                                       val : in out A_Value ); 
  72.     pragma Precondition( var'Length > 0 ); 
  73.     pragma Postcondition( val = null ); 
  74.  
  75.     procedure Queue_Loading( loading : Boolean ); 
  76.  
  77.     procedure Queue_New_Game; 
  78.  
  79.     procedure Queue_Pause_Game( paused : Boolean ); 
  80.  
  81.     procedure Queue_Scroll_View( x, y : Float ); 
  82.  
  83. private 
  84.  
  85.     type Game_Paused_Event is new Event with 
  86.         record 
  87.             paused : Boolean := True; 
  88.         end record; 
  89.  
  90.     procedure Construct( this : access Game_Paused_Event; paused : Boolean ); 
  91.  
  92.     ---------------------------------------------------------------------------- 
  93.  
  94.     type Game_Var_Changed_Event is new Event with 
  95.         record 
  96.             var : Unbounded_String; 
  97.             val : A_Value := null; 
  98.         end record; 
  99.  
  100.     procedure Adjust( this : access Game_Var_Changed_Event ); 
  101.  
  102.     procedure Construct( this : access Game_Var_Changed_Event; 
  103.                          var  : String; 
  104.                          val  : in out A_Value ); 
  105.     pragma Precondition( var'Length > 0 ); 
  106.     pragma Postcondition( val = null ); 
  107.  
  108.     procedure Delete( this : in out Game_Var_Changed_Event ); 
  109.  
  110.     ---------------------------------------------------------------------------- 
  111.  
  112.     type Loading_Event is new Event with 
  113.         record 
  114.             loading : Boolean; 
  115.         end record; 
  116.  
  117.     procedure Construct( this : access Loading_Event; loading : Boolean ); 
  118.  
  119.     ---------------------------------------------------------------------------- 
  120.  
  121.     type New_Game_Event is new Event with null record; 
  122.  
  123.     ---------------------------------------------------------------------------- 
  124.  
  125.     type Pause_Game_Event is new Event with 
  126.         record 
  127.             paused : Boolean := True; 
  128.         end record; 
  129.  
  130.     procedure Construct( this : access Pause_Game_Event; paused : Boolean ); 
  131.  
  132.     ---------------------------------------------------------------------------- 
  133.  
  134.     type Scroll_View_Event is new Event with 
  135.         record 
  136.             x, y : Float := 0.0; 
  137.         end record; 
  138.  
  139.     procedure Construct( this : access Scroll_View_Event; x, y : Float ); 
  140.  
  141. end Events.Game;