1. with Associations;                      use Associations; 
  2. with Directions;                        use Directions; 
  3. with Events; 
  4. with Entities;                          use Entities; 
  5. with Hashed_Strings;                    use Hashed_Strings; 
  6. with Values;                            use Values; 
  7.  
  8. pragma Elaborate_All( Events ); 
  9.  
  10. package Events.Entities is 
  11.  
  12.     type Entity_Event is abstract new Event with private; 
  13.  
  14.     function Get_Id( this : not null access Entity_Event'Class ) return Entity_Id; 
  15.  
  16.     ---------------------------------------------------------------------------- 
  17.  
  18.     type Entities_Event is abstract new Event with private; 
  19.  
  20.     function Get_A( this : not null access Entities_Event'Class ) return Entity_Id; 
  21.  
  22.     function Get_B( this : not null access Entities_Event'Class ) return Entity_Id; 
  23.  
  24.     ---------------------------------------------------------------------------- 
  25.  
  26.     type Accelerate_Event is new Entity_Event with private; 
  27.     type A_Accelerate_Event is access all Accelerate_Event'Class; 
  28.  
  29.     ACCELERATE_ID : constant Event_Id := To_Event_Id( "Accelerate" ); 
  30.  
  31.     function Get_Acceleration( this : not null access Accelerate_Event'Class ) return Float; 
  32.     pragma Postcondition( Get_Acceleration'Result >= 0.0 ); 
  33.  
  34.     function Get_Direction( this : not null access Accelerate_Event'Class ) return Cardinal_Direction; 
  35.  
  36.     function Get_Velocity( this : not null access Accelerate_Event'Class ) return Float; 
  37.     pragma Postcondition( Get_Velocity'Result >= 0.0 ); 
  38.  
  39.     ---------------------------------------------------------------------------- 
  40.  
  41.     type Delete_Entity_Event is new Entity_Event with private; 
  42.     type A_Delete_Entity_Event is access all Delete_Entity_Event'Class; 
  43.  
  44.     DELETE_ENTITY_ID : constant Event_Id := To_Event_Id( "Delete_Entity" ); 
  45.  
  46.     ---------------------------------------------------------------------------- 
  47.  
  48.     type Entities_Collided_Event is new Entities_Event with private; 
  49.     type A_Entities_Collided_Event is access all Entities_Collided_Event'Class; 
  50.  
  51.     ENTITIES_COLLIDED_ID: constant Event_Id := To_Event_Id( "Entities_Collided" ); 
  52.  
  53.     ---------------------------------------------------------------------------- 
  54.  
  55.     type Entities_Separated_Event is new Entities_Event with private; 
  56.     type A_Entities_Separated_Event is access all Entities_Separated_Event'Class; 
  57.  
  58.     ENTITIES_SEPARATED_ID: constant Event_Id := To_Event_Id( "Entities_Separated" ); 
  59.  
  60.     ---------------------------------------------------------------------------- 
  61.  
  62.     type Entity_Attribute_Event is new Entity_Event with private; 
  63.  
  64.     -- Returns a copy of the attribute value. The caller is responsible for 
  65.     -- deleting the object. 
  66.     procedure Copy_Value( this : access Entity_Attribute_Event; 
  67.                           val  : in out A_Value ); 
  68.     pragma Precondition( val = null ); 
  69.  
  70.     -- Returns the attribute name. 
  71.     function Get_Attribute( this : access Entity_Attribute_Event ) return String; 
  72.     pragma Postcondition( Get_Attribute'Result'Length > 0 ); 
  73.  
  74.     ---------------------------------------------------------------------------- 
  75.  
  76.     type Entity_Attribute_Changed_Event is new Entity_Attribute_Event with private; 
  77.     type A_Entity_Attribute_Changed_Event is access all Entity_Attribute_Changed_Event; 
  78.  
  79.     ENTITY_ATTRIBUTE_CHANGED_ID : constant Event_Id := To_Event_Id( "Entity_Attribute_Changed" ); 
  80.  
  81.     ---------------------------------------------------------------------------- 
  82.  
  83.     type Entity_Created_Event is new Entity_Event with private; 
  84.     type A_Entity_Created_Event is access all Entity_Created_Event'Class; 
  85.  
  86.     ENTITY_CREATED_ID : constant Event_Id := To_Event_Id( "Entity_Created" ); 
  87.  
  88.     procedure Copy_Attributes( this       : not null access Entity_Created_Event'Class; 
  89.                                attributes : in out A_Association ); 
  90.     pragma Precondition( attributes = null ); 
  91.     pragma Postcondition( attributes /= null ); 
  92.  
  93.     function Get_Class( this : not null access Entity_Created_Event'Class ) return String; 
  94.     pragma Postcondition( Get_Class'Result'Length > 0 ); 
  95.  
  96.     function Get_Frame( this : not null access Entity_Created_Event'Class ) return Natural; 
  97.  
  98.     function Get_Height( this : not null access Entity_Created_Event'Class ) return Natural; 
  99.  
  100.     function Get_Lib_Name( this : not null access Entity_Created_Event'Class ) return String; 
  101.  
  102.     function Get_Width( this : not null access Entity_Created_Event'Class ) return Natural; 
  103.  
  104.     function Get_X( this : not null access Entity_Created_Event'Class ) return Float; 
  105.  
  106.     function Get_XV( this : not null access Entity_Created_Event'Class ) return Float; 
  107.  
  108.     function Get_Y( this : not null access Entity_Created_Event'Class ) return Float; 
  109.  
  110.     function Get_YV( this : not null access Entity_Created_Event'Class ) return Float; 
  111.  
  112.     function Is_Clipped( this : not null access Entity_Created_Event'Class ) return Boolean; 
  113.  
  114.     function Is_Metaphysical( this : not null access Entity_Created_Event'Class ) return Boolean; 
  115.  
  116.     function Is_Physical( this : not null access Entity_Created_Event'Class ) return Boolean; 
  117.  
  118.     ---------------------------------------------------------------------------- 
  119.  
  120.     type Entity_Deleted_Event is new Entity_Event with private; 
  121.     type A_Entity_Deleted_Event is access all Entity_Deleted_Event'Class; 
  122.  
  123.     ENTITY_DELETED_ID : constant Event_Id := To_Event_Id( "Entity_Deleted" ); 
  124.  
  125.     ---------------------------------------------------------------------------- 
  126.  
  127.     type Entity_Face_Event is new Entity_Event with private; 
  128.     type A_Entity_Face_Event is access all Entity_Face_Event'Class; 
  129.  
  130.     ENTITY_FACE_ID : constant Event_Id := To_Event_Id( "Entity_Face" ); 
  131.  
  132.     function Get_Direction( this : not null access Entity_Face_Event'Class ) return Direction_Type; 
  133.  
  134.     ---------------------------------------------------------------------------- 
  135.  
  136.     type Entity_Grounded_Event is new Entity_Event with private; 
  137.     type A_Entity_Grounded_Event is access all Entity_Grounded_Event'Class; 
  138.  
  139.     ENTITY_GROUNDED_ID : constant Event_Id := To_Event_Id( "Entity_Grounded" ); 
  140.  
  141.     function Is_Grounded( this : not null access Entity_Grounded_Event'Class ) return Boolean; 
  142.  
  143.     ---------------------------------------------------------------------------- 
  144.  
  145.     type Entity_Hit_Wall_Event is new Entity_Event with private; 
  146.     type A_Entity_Hit_Wall_Event is access all Entity_Hit_Wall_Event'Class; 
  147.  
  148.     ENTITY_HIT_WALL_ID : constant Event_Id := To_Event_Id( "Entity_Hit_Wall" ); 
  149.  
  150.     function Get_Direction( this : not null access Entity_Hit_Wall_Event'Class ) return Cardinal_Direction; 
  151.  
  152.     ---------------------------------------------------------------------------- 
  153.  
  154.     type Entity_Moved_Event is new Entity_Event with private; 
  155.     type A_Entity_Moved_Event is access all Entity_Moved_Event'Class; 
  156.  
  157.     ENTITY_MOVED_ID : constant Event_Id := To_Event_Id( "Entity_Moved" ); 
  158.  
  159.     function Get_X( this : not null access Entity_Moved_Event'Class ) return Float; 
  160.  
  161.     function Get_XV( this : not null access Entity_Moved_Event'Class ) return Float; 
  162.  
  163.     function Get_Y( this : not null access Entity_Moved_Event'Class ) return Float; 
  164.  
  165.     function Get_YV( this : not null access Entity_Moved_Event'Class ) return Float; 
  166.  
  167.     ---------------------------------------------------------------------------- 
  168.  
  169.     type Entity_Resized_Event is new Entity_Event with private; 
  170.     type A_Entity_Resized_Event is access all Entity_Resized_Event'Class; 
  171.  
  172.     ENTITY_RESIZED_ID : constant Event_Id := To_Event_Id( "Entity_Resized" ); 
  173.  
  174.     function Get_Height( this : not null access Entity_Resized_Event'Class ) return Natural; 
  175.  
  176.     function Get_Width( this : not null access Entity_Resized_Event'Class ) return Natural; 
  177.  
  178.     ---------------------------------------------------------------------------- 
  179.  
  180.     type Follow_Entity_Event is new Entity_Event with private; 
  181.     type A_Follow_Entity_Event is access all Follow_Entity_Event'Class; 
  182.  
  183.     FOLLOW_ENTITY_ID : constant Event_Id := To_Event_Id( "Follow_Entity" ); 
  184.  
  185.     ---------------------------------------------------------------------------- 
  186.  
  187.     type Frame_Changed_Event is new Entity_Event with private; 
  188.     type A_Frame_Changed_Event is access all Frame_Changed_Event'Class; 
  189.  
  190.     FRAME_CHANGED_ID : constant Event_Id := To_Event_Id( "Frame_Changed" ); 
  191.  
  192.     function Get_Frame( this : not null access Frame_Changed_Event'Class ) return Natural; 
  193.  
  194.     ---------------------------------------------------------------------------- 
  195.  
  196.     type Impulse_Event is new Entity_Event with private; 
  197.     type A_Impulse_Event is access all Impulse_Event'Class; 
  198.  
  199.     IMPULSE_ID : constant Event_Id := To_Event_Id( "Impulse" ); 
  200.  
  201.     function Get_Impulse_Name( this : not null access Impulse_Event'Class ) return Hashed_String; 
  202.  
  203.     ---------------------------------------------------------------------------- 
  204.  
  205.     type Move_Entity_Event is new Entity_Event with private; 
  206.     type A_Move_Entity_Event is access all Move_Entity_Event'Class; 
  207.  
  208.     MOVE_ENTITY_ID : constant Event_Id := To_Event_Id( "Move_Entity" ); 
  209.  
  210.     function Get_X( this : not null access Move_Entity_Event'Class ) return Float; 
  211.  
  212.     function Get_Y( this : not null access Move_Entity_Event'Class ) return Float; 
  213.  
  214.     ---------------------------------------------------------------------------- 
  215.  
  216.     type Resize_Entity_Event is new Entity_Event with private; 
  217.     type A_Resize_Entity_Event is access all Resize_Entity_Event'Class; 
  218.  
  219.     RESIZE_ENTITY_ID : constant Event_Id := To_Event_Id( "Resize_Entity" ); 
  220.  
  221.     function Get_Height( this : not null access Resize_Entity_Event'Class ) return Natural; 
  222.  
  223.     function Get_Width( this : not null access Resize_Entity_Event'Class ) return Natural; 
  224.  
  225.     ---------------------------------------------------------------------------- 
  226.  
  227.     type Set_Entity_Attribute_Event is new Entity_Attribute_Event with private; 
  228.     type A_Set_Entity_Attribute_Event is access all Set_Entity_Attribute_Event; 
  229.  
  230.     SET_ENTITY_ATTRIBUTE_ID : constant Event_Id := To_Event_Id( "Set_Entity_Attribute" ); 
  231.  
  232.     ---------------------------------------------------------------------------- 
  233.  
  234.     type Spawn_Entity_Event is new Event with private; 
  235.     type A_Spawn_Entity_Event is access all Spawn_Entity_Event; 
  236.  
  237.     SPAWN_ENTITY_ID : constant Event_Id := To_Event_Id( "Spawn_Entity" ); 
  238.  
  239.     function Get_Height( this : access Spawn_Entity_Event ) return Integer; 
  240.  
  241.     function Get_Id( this : access Spawn_Entity_Event ) return String; 
  242.  
  243.     function Get_Width( this : access Spawn_Entity_Event ) return Integer; 
  244.  
  245.     function Get_X( this : access Spawn_Entity_Event ) return Float; 
  246.  
  247.     function Get_XV( this : access Spawn_Entity_Event ) return Float; 
  248.  
  249.     function Get_Y( this : access Spawn_Entity_Event ) return Float; 
  250.  
  251.     function Get_YV( this : access Spawn_Entity_Event ) return Float; 
  252.  
  253.     ---------------------------------------------------------------------------- 
  254.  
  255.     procedure Queue_Accelerate( id  : Entity_Id; 
  256.                                 dir : Cardinal_Direction; 
  257.                                 vel : Float; 
  258.                                 acc : Float ); 
  259.     pragma Precondition( vel >= 0.0 ); 
  260.     pragma Precondition( acc >= 0.0 ); 
  261.  
  262.     procedure Queue_Delete_Entity( id : Entity_Id ); 
  263.  
  264.     procedure Queue_Entities_Collided( a, b : Entity_Id ); 
  265.  
  266.     procedure Queue_Entities_Separated( a, b : Entity_Id ); 
  267.  
  268.     procedure Queue_Entity_Attribute_Changed( id        : Entity_Id; 
  269.                                               attribute : String; 
  270.                                               val       : in out A_Value ); 
  271.     pragma Precondition( attribute'Length > 0 ); 
  272.     pragma Postcondition( val = null ); 
  273.  
  274.     -- Argument 'attributes' is copied and unchanged. 
  275.     procedure Queue_Entity_Created( id           : Entity_Id; 
  276.                                     class        : String; 
  277.                                     physical, 
  278.                                     metaphysical, 
  279.                                     clipped      : Boolean; 
  280.                                     width, 
  281.                                     height       : Natural; 
  282.                                     x, y         : Float; 
  283.                                     xv, yv       : Float; 
  284.                                     libName      : String; 
  285.                                     frame        : Natural; 
  286.                                     attributes   : not null A_Association ); 
  287.     pragma Precondition( class'Length > 0 ); 
  288.  
  289.     procedure Queue_Entity_Deleted( id : Entity_Id ); 
  290.  
  291.     procedure Queue_Entity_Face( id : Entity_Id; dir : Direction_Type ); 
  292.  
  293.     procedure Queue_Entity_Grounded( id : Entity_Id; grounded : Boolean ); 
  294.  
  295.     procedure Queue_Entity_Hit_Wall( id : Entity_Id; dir : Cardinal_Direction ); 
  296.  
  297.     procedure Queue_Entity_Moved( id : Entity_Id; x, y, xv, yv : Float ); 
  298.  
  299.     procedure Queue_Entity_Resized( id : Entity_Id; width, height : Natural ); 
  300.  
  301.     procedure Queue_Impulse( id : Entity_Id; name : Hashed_String ); 
  302.  
  303.     procedure Queue_Follow_Entity( id : Entity_Id ); 
  304.  
  305.     procedure Queue_Frame_Changed( id : Entity_Id; frame : Natural ); 
  306.  
  307.     procedure Queue_Move_Entity( id : Entity_Id; x, y : Float ); 
  308.  
  309.     procedure Queue_Resize_Entity( id : Entity_Id; width, height : Natural ); 
  310.  
  311.     procedure Queue_Set_Entity_Attribute( id        : Entity_Id; 
  312.                                           attribute : String; 
  313.                                           val       : in out A_Value ); 
  314.     pragma Precondition( attribute'Length > 0 ); 
  315.     pragma Postcondition( val = null ); 
  316.  
  317.     procedure Queue_Spawn_Entity( id     : String; 
  318.                                   x, y   : Float; 
  319.                                   width, 
  320.                                   height : Natural := 0; 
  321.                                   xv, yv : Float := 0.0 ); 
  322.     pragma Precondition( id'Length > 0 ); 
  323.  
  324. private 
  325.  
  326.     type Entity_Event is abstract new Event with 
  327.         record 
  328.             id : Entity_Id := INVALID_ID; 
  329.         end record; 
  330.  
  331.     procedure Construct( this : access Entity_Event; name : String; id : Entity_Id ); 
  332.     pragma Precondition( name'Length > 0 ); 
  333.  
  334.     ---------------------------------------------------------------------------- 
  335.  
  336.     type Entities_Event is abstract new Event with 
  337.         record 
  338.             a, b : Entity_Id := INVALID_ID; 
  339.         end record; 
  340.  
  341.     procedure Construct( this : access Entities_Event; name : String; a, b : Entity_Id ); 
  342.     pragma Precondition( name'Length > 0 ); 
  343.  
  344.     ---------------------------------------------------------------------------- 
  345.  
  346.     type Accelerate_Event is new Entity_Event with 
  347.         record 
  348.             dir : Cardinal_Direction := Left; 
  349.             vel : Float := 0.0; 
  350.             acc : Float := 0.0; 
  351.         end record; 
  352.  
  353.     procedure Construct( this : access Accelerate_Event; 
  354.                          id   : Entity_Id; 
  355.                          dir  : Cardinal_Direction; 
  356.                          vel  : Float; 
  357.                          acc  : Float ); 
  358.  
  359.     ---------------------------------------------------------------------------- 
  360.  
  361.     type Delete_Entity_Event is new Entity_Event with null record; 
  362.  
  363.     procedure Construct( this : access Delete_Entity_Event; id : Entity_Id ); 
  364.  
  365.     ---------------------------------------------------------------------------- 
  366.  
  367.     type Entities_Collided_Event is new Entities_Event with null record; 
  368.  
  369.     procedure Construct( this : access Entities_Collided_Event; a, b : Entity_Id ); 
  370.  
  371.     ---------------------------------------------------------------------------- 
  372.  
  373.     type Entities_Separated_Event is new Entities_Event with null record; 
  374.  
  375.     procedure Construct( this : access Entities_Separated_Event; a, b : Entity_Id ); 
  376.  
  377.     ---------------------------------------------------------------------------- 
  378.  
  379.     type Entity_Attribute_Event is new Entity_Event with 
  380.         record 
  381.             attribute : Unbounded_String; 
  382.             val       : A_Value := null; 
  383.         end record; 
  384.  
  385.     procedure Adjust( this : access Entity_Attribute_Event ); 
  386.  
  387.     -- 'name' is event name 
  388.     -- 'attribute' is the name of the attribute 
  389.     -- 'val' is the value of the attribute 
  390.     procedure Construct( this      : access Entity_Attribute_Event; 
  391.                          name      : String; 
  392.                          id        : Entity_Id; 
  393.                          attribute : String; 
  394.                          val       : in out A_Value ); 
  395.     pragma Precondition( name'Length > 0 ); 
  396.     pragma Precondition( attribute'Length > 0 ); 
  397.     pragma Postcondition( val = null ); 
  398.  
  399.     procedure Delete( this : in out Entity_Attribute_Event ); 
  400.  
  401.     ---------------------------------------------------------------------------- 
  402.  
  403.     type Entity_Attribute_Changed_Event is new Entity_Attribute_Event with null record; 
  404.  
  405.     procedure Construct( this      : access Entity_Attribute_Changed_Event; 
  406.                          id        : Entity_Id; 
  407.                          attribute : String; 
  408.                          val       : in out A_Value ); 
  409.     pragma Precondition( attribute'Length > 0 ); 
  410.     pragma Postcondition( val = null ); 
  411.  
  412.     ---------------------------------------------------------------------------- 
  413.  
  414.     type Entity_Created_Event is new Entity_Event with 
  415.         record 
  416.             class        : Unbounded_String; 
  417.             physical     : Boolean := True; 
  418.             metaphysical : Boolean := False; 
  419.             clipped      : Boolean := True; 
  420.             width, 
  421.             height       : Natural := 0; 
  422.             x, y         : Float := 0.0; 
  423.             xv, yv       : Float := 0.0; 
  424.             libName      : Unbounded_String; 
  425.             frame        : Natural := 0; 
  426.             attributes   : A_Association := null; 
  427.         end record; 
  428.  
  429.     procedure Adjust( this : access Entity_Created_Event ); 
  430.  
  431.     procedure Construct( this         : access Entity_Created_Event; 
  432.                          id           : Entity_Id; 
  433.                          class        : String; 
  434.                          physical, 
  435.                          metaphysical, 
  436.                          clipped      : Boolean; 
  437.                          width, 
  438.                          height       : Natural; 
  439.                          x, y         : Float; 
  440.                          xv, yv       : Float; 
  441.                          libName      : String; 
  442.                          frame        : Natural; 
  443.                          attributes   : not null A_Association ); 
  444.  
  445.     procedure Delete( this : in out Entity_Created_Event ); 
  446.  
  447.     ---------------------------------------------------------------------------- 
  448.  
  449.     type Entity_Deleted_Event is new Entity_Event with null record; 
  450.  
  451.     procedure Construct( this : access Entity_Deleted_Event; id : Entity_Id ); 
  452.  
  453.     ---------------------------------------------------------------------------- 
  454.  
  455.     type Entity_Face_Event is new Entity_Event with 
  456.         record 
  457.             dir : Direction_Type := Dir_Left; 
  458.         end record; 
  459.  
  460.     procedure Construct( this : access Entity_Face_Event; 
  461.                          id   : Entity_Id; 
  462.                          dir  : Direction_Type ); 
  463.  
  464.     ---------------------------------------------------------------------------- 
  465.  
  466.     type Entity_Grounded_Event is new Entity_Event with 
  467.         record 
  468.             grounded : Boolean := False; 
  469.         end record; 
  470.  
  471.     procedure Construct( this     : access Entity_Grounded_Event; 
  472.                          id       : Entity_Id; 
  473.                          grounded : Boolean ); 
  474.  
  475.     ---------------------------------------------------------------------------- 
  476.  
  477.     type Entity_Hit_Wall_Event is new Entity_Event with 
  478.         record 
  479.             dir : Cardinal_Direction; 
  480.         end record; 
  481.  
  482.     procedure Construct( this : access Entity_Hit_Wall_Event; 
  483.                          id   : Entity_Id; 
  484.                          dir  : Cardinal_Direction ); 
  485.  
  486.     ---------------------------------------------------------------------------- 
  487.  
  488.     type Entity_Moved_Event is new Entity_Event with 
  489.         record 
  490.             x, y   : Float := 0.0; 
  491.             xv, yv : Float := 0.0; 
  492.         end record; 
  493.  
  494.     procedure Construct( this   : access Entity_Moved_Event; 
  495.                          id     : Entity_Id; 
  496.                          x, y   : Float; 
  497.                          xv, yv : Float ); 
  498.  
  499.     ---------------------------------------------------------------------------- 
  500.  
  501.     type Entity_Resized_Event is new Entity_Event with 
  502.         record 
  503.             width, height : Natural := 0; 
  504.         end record; 
  505.  
  506.     procedure Construct( this   : access Entity_Resized_Event; 
  507.                          id     : Entity_Id; 
  508.                          width, 
  509.                          height : Natural ); 
  510.  
  511.     ---------------------------------------------------------------------------- 
  512.  
  513.     type Follow_Entity_Event is new Entity_Event with null record; 
  514.  
  515.     procedure Construct( this : access Follow_Entity_Event; id : Entity_Id ); 
  516.  
  517.     ---------------------------------------------------------------------------- 
  518.  
  519.     type Frame_Changed_Event is new Entity_Event with 
  520.         record 
  521.             frame : Natural; 
  522.         end record; 
  523.  
  524.     procedure Construct( this  : access Frame_Changed_Event; 
  525.                          id    : Entity_Id; 
  526.                          frame : Natural ); 
  527.  
  528.     ---------------------------------------------------------------------------- 
  529.  
  530.     type Impulse_Event is new Entity_Event with 
  531.         record 
  532.             name : Hashed_String; 
  533.         end record; 
  534.  
  535.     procedure Construct( this : access Impulse_Event; 
  536.                          id   : Entity_Id; 
  537.                          name : Hashed_String ); 
  538.  
  539.     ---------------------------------------------------------------------------- 
  540.  
  541.     type Move_Entity_Event is new Entity_Event with 
  542.         record 
  543.             x, y : Float := 0.0; 
  544.         end record; 
  545.  
  546.     procedure Construct( this : access Move_Entity_Event; 
  547.                          id   : Entity_Id; 
  548.                          x, y : Float ); 
  549.  
  550.     ---------------------------------------------------------------------------- 
  551.  
  552.     type Resize_Entity_Event is new Entity_Event with 
  553.         record 
  554.             width, height : Natural := 0; 
  555.         end record; 
  556.  
  557.     procedure Construct( this   : access Resize_Entity_Event; 
  558.                          id     : Entity_Id; 
  559.                          width, 
  560.                          height : Natural ); 
  561.  
  562.     ---------------------------------------------------------------------------- 
  563.  
  564.     type Set_Entity_Attribute_Event is new Entity_Attribute_Event with null record; 
  565.  
  566.     procedure Construct( this      : access Set_Entity_Attribute_Event; 
  567.                          id        : Entity_Id; 
  568.                          attribute : String; 
  569.                          val       : in out A_Value ); 
  570.     pragma Precondition( attribute'Length > 0 ); 
  571.     pragma Postcondition( val = null ); 
  572.  
  573.     ---------------------------------------------------------------------------- 
  574.  
  575.     type Spawn_Entity_Event is new Event with 
  576.         record 
  577.             id     : Unbounded_String; 
  578.             x, y   : Float; 
  579.             width, 
  580.             height : Natural; 
  581.             xv, yv : Float; 
  582.         end record; 
  583.  
  584.     procedure Construct( this   : access Spawn_Entity_Event; 
  585.                          id     : String; 
  586.                          x, y   : Float; 
  587.                          width, 
  588.                          height : Natural; 
  589.                          xv, yv : Float ); 
  590.     pragma Precondition( id'Length > 0 ); 
  591.  
  592. end Events.Entities;