1. private with Events.Entities; 
  2. private with Events.Keen; 
  3. private with Events.Game; 
  4.  
  5. package Games.Keen is 
  6.  
  7.     pragma Elaborate_Body; 
  8.  
  9. private 
  10.  
  11.     use Events.Entities; 
  12.     use Events.Game; 
  13.     use Events.Keen; 
  14.  
  15.     type Keen_Game is new Game with 
  16.         record 
  17.             dialogId   : Integer := Integer'First;    -- current open dialog 
  18.             mapWorld   : A_World; 
  19.             playingMap : Boolean := True;    -- playing the overhead map 
  20.         end record; 
  21.  
  22.     procedure Add_Event_Listeners( this : access Keen_Game ); 
  23.  
  24.     procedure Delete( this : in out Keen_Game ); 
  25.  
  26.     procedure End_Game( this : access Keen_Game ); 
  27.  
  28.     -- Enters a level, raising an exception on error loading world 'name'. 
  29.     procedure Enter_Level( this : not null access Keen_Game'Class; 
  30.                            name : String ); 
  31.  
  32.     -- Exits a level, returning to the overhead map. If 'success' is True, the 
  33.     -- current level will be marked as complete in the game session. An 
  34.     -- exception will be raised on error loading the world. 
  35.     procedure Exit_Level( this    : not null access Keen_Game'Class; 
  36.                           success : Boolean ); 
  37.  
  38.     procedure Handle_Event( this : access Keen_Game; 
  39.                             evt  : in out A_Event; 
  40.                             resp : out Response_Type ); 
  41.     pragma Precondition( evt /= null ); 
  42.  
  43.     procedure Handle( this : not null access Keen_Game'Class; 
  44.                       evt  : not null A_Dialog_Response_Event ); 
  45.  
  46.     procedure Handle( this : not null access Keen_Game'Class; 
  47.                       evt  : not null A_Entity_Entered_Tile_Event ); 
  48.  
  49.     procedure Handle( this : not null access Keen_Game'Class; 
  50.                       evt  : not null A_Give_Ammo_Event ); 
  51.  
  52.     procedure Handle( this : not null access Keen_Game'Class; 
  53.                       evt  : not null A_Give_Drops_Event ); 
  54.  
  55.     procedure Handle( this : not null access Keen_Game'Class; 
  56.                       evt  : not null A_Give_Points_Event ); 
  57.  
  58.     procedure Handle( this : not null access Keen_Game'Class; 
  59.                       evt  : not null A_Impulse_Event ); 
  60.  
  61.     procedure Handle( this : not null access Keen_Game'Class; 
  62.                       evt  : not null A_Player_Died_Event ); 
  63.  
  64.     procedure Handle( this : not null access Keen_Game'Class; 
  65.                       evt  : not null A_Set_Tile_Event ); 
  66.  
  67.     -- Called when the Load_World event is received, to load the next level. If 
  68.     -- the world name to load is an empty string, the current level will be 
  69.     -- exited, marked as complete, and the overhead map will be loaded. No 
  70.     -- exception will be raised on error; the error message will be put into the 
  71.     -- response 'resp'. 
  72.     procedure Handle_Load_World( this : access Keen_Game; 
  73.                                  evt  : not null A_Load_World_Event; 
  74.                                  resp : out Response_Type ); 
  75.  
  76.     procedure New_Game( this : access Keen_Game ); 
  77.  
  78.     procedure One_Up( this : not null access Keen_Game'Class ); 
  79.  
  80.     procedure Pause( this : access Keen_Game; enabled : Boolean ); 
  81.  
  82.     procedure Remove_Event_Listeners( this : access Keen_Game ); 
  83.  
  84.     -- Reloads the current level. An exception will be raised on error loading 
  85.     -- the world. 
  86.     procedure Retry_Level( this : not null access Keen_Game'Class ); 
  87.  
  88. end Games.Keen;