1. package Entities.Triggers is 
  2.  
  3.     type Trigger is abstract new Entity with private; 
  4.     type A_Trigger is access all Trigger'Class; 
  5.  
  6.     -- Implement this procedure to execute the trigger's action. Execute is 
  7.     -- called when the conditions for executing the trigger are met. 'action' is 
  8.     -- canonically lower case. 'activator' may be null if there is no activating 
  9.     -- entity. (ex: executing on world load) 
  10.     procedure Execute( this      : access Trigger; 
  11.                        action, 
  12.                        argument  : String; 
  13.                        activator : A_Entity ) is abstract; 
  14.  
  15. private 
  16.  
  17.     WHEN_ATTR   : constant String := "When"; 
  18.     ACTION_ATTR : constant String := "Action"; 
  19.     ARG_ATTR    : constant String := "Argument"; 
  20.  
  21.     type Trigger is abstract new Entity with 
  22.         record 
  23.             activatable : Boolean := True; 
  24.         end record; 
  25.  
  26.     procedure Construct( this    : access Trigger; 
  27.                          libName : String; 
  28.                          icon    : String ); 
  29.  
  30.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Trigger ); 
  31.     for Trigger'Read use Object_Read; 
  32.  
  33.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Trigger ); 
  34.     for Trigger'Write use Object_Write; 
  35.  
  36.     -- Called when the trigger entity is activated by an entity. 
  37.     procedure On_Activate( this      : access Trigger; 
  38.                            activator : not null A_Entity ); 
  39.  
  40.     -- Called when the trigger is touched by an entity. 
  41.     procedure On_Collide( this : access Trigger; e : not null A_Entity ); 
  42.  
  43.     procedure Delete( this : in out A_Trigger ); 
  44.     pragma Postcondition( this = null ); 
  45.  
  46. end Entities.Triggers;