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