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