1. private with Tiles; 
  2.  
  3. package Entities.Sprites is 
  4.  
  5.     type Sprite is abstract new Entity with private; 
  6.  
  7. private 
  8.  
  9.     use Tiles; 
  10.  
  11.     type Sprite is abstract new Entity with 
  12.         record 
  13.             -- ** constant for the life of the object; fields not streamed ** 
  14.             lifeSpan   : Time_Span := Time_Span_Zero; 
  15.             frameDelay : Time_Span := Time_Span_Zero; 
  16.             frames     : A_Tile_Id_Array := null; 
  17.         end record; 
  18.  
  19.     procedure Construct( this       : access Sprite; 
  20.                          width, 
  21.                          height     : Natural; 
  22.                          libName    : String; 
  23.                          frames     : not null A_Tile_Id_Array; 
  24.                          lifeSpan   : Time_Span; 
  25.                          frameDelay : Time_Span ); 
  26.     pragma Precondition( libName'Length > 0 ); 
  27.  
  28.     procedure Delete( this : in out Sprite ); 
  29.  
  30.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Sprite ); 
  31.     for Sprite'Read use Object_Read; 
  32.  
  33.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Sprite ); 
  34.     for Sprite'Write use Object_Write; 
  35.  
  36.     procedure Tick( this : access Sprite; upTime, dt : Time_Span ); 
  37.  
  38.     procedure Update_Frame( this : access Sprite; notify : Boolean := True ); 
  39.  
  40. end Entities.Sprites;