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. package Tiles.Keen is 
  10.  
  11.     type Action_Type is (NONE, HAZZARD, POLE, WATER, END_LEVEL, ENTER_LEVEL); 
  12. --    for Action_Type use ( 
  13. --        0 => NONE, 
  14. --        1 => HAZZARD, 
  15. --        2 => POLE, 
  16. --        3 => WATER, 
  17. --        4 => END_LEVEL, 
  18. --        5 => ENTER_LEVEL 
  19. --    ); 
  20.  
  21.     function ">"( l, r : Action_Type ) return Boolean; 
  22.  
  23.     type Keen_Tile is new Tile_Object with private; 
  24.     type A_Keen_Tile is access all Keen_Tile'Class; 
  25.  
  26.     function Get_Action( this : not null access Keen_Tile'Class ) return Action_Type; 
  27.  
  28. private 
  29.  
  30.     type Keen_Tile is new Tile_Object with 
  31.         record 
  32.             action : Action_Type := NONE; 
  33.         end record; 
  34.  
  35.     function Object_Input( stream : access Root_Stream_Type'Class ) return Keen_Tile; 
  36.     for Keen_Tile'Input use Object_Input; 
  37.  
  38.     procedure Object_Output( stream : access Root_Stream_Type'Class; obj : Keen_Tile ); 
  39.     for Keen_Tile'Output use Object_Output; 
  40.  
  41.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Keen_Tile ); 
  42.     for Keen_Tile'Read use Object_Read; 
  43.  
  44.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Keen_Tile ); 
  45.     for Keen_Tile'Write use Object_Write; 
  46.  
  47.     procedure Set_Attribute( this  : in out Keen_Tile; 
  48.                              found : out Boolean; 
  49.                              name  : String; 
  50.                              val   : String := "" ); 
  51.     pragma Precondition( name'Length > 0 ); 
  52.  
  53. end Tiles.Keen;