1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Tiles.Keen;                        use Tiles.Keen; 
  10.  
  11. package Worlds.Keen is 
  12.  
  13.     type Keen_World is new World_Object with private; 
  14.     type A_Keen_World is access all Keen_World'Class; 
  15.  
  16.     -- Returns the 'action' attribute of the tile at the given location. The 
  17.     -- dominant action of the tiles in each layer at 'x,y' will be returned. 
  18.     function Get_Action( this : not null access Keen_World'Class; 
  19.                          x, y : Integer ) return Action_Type; 
  20.  
  21. private 
  22.  
  23.     type Keen_World is new World_Object with 
  24.         record 
  25.             -- the following fields are streamed 
  26.             introduction : Unbounded_String; 
  27.         end record; 
  28.  
  29.     -- Constructs the world without a map or library name; used for streaming. 
  30.     procedure Construct( this : access Keen_World ); 
  31.  
  32.     -- Constructs a new empty world with the given arguments 
  33.     procedure Construct( this    : access Keen_World; 
  34.                          width, 
  35.                          height  : Positive; 
  36.                          libName, 
  37.                          domain  : String ); 
  38.     pragma Precondition( libName'Length > 0 ); 
  39.     pragma Precondition( domain'Length > 0 ); 
  40.  
  41.     function Object_Input( stream : access Root_Stream_Type'Class ) return Keen_World; 
  42.     for Keen_World'Input use Object_Input; 
  43.  
  44.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Keen_World ); 
  45.     for Keen_World'Read use Object_Read; 
  46.  
  47.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Keen_World ); 
  48.     for Keen_World'Write use Object_Write; 
  49.  
  50.     procedure Queue_Load_Events( this : access Keen_World ); 
  51.  
  52.     -- extended keen properties: 
  53.     -- "introduction" : the introduction text 
  54.     procedure Set_Property( this : access Keen_World; name, value : String ); 
  55.     pragma Precondition( name'Length > 0 ); 
  56.  
  57. end Worlds.Keen;