1. package Entities.Players is 
  2.  
  3.     type Player is abstract new Entity with private; 
  4.     type A_Player is access all Player'Class; 
  5.  
  6.     -- Notifies the player that something deadly happened to it and it should 
  7.     -- die. The player entity may choose to do nothing if it is currently 
  8.     -- invincible. This procedure must be overridden to provide an 
  9.     -- implementation. 
  10.     procedure Die( this : access Player ) is abstract; 
  11.  
  12.     -- Notifies the player entity that a "start movement" impulse in direction 
  13.     -- 'dir' was received. This procedure must be overridden to provide an 
  14.     -- implementation. 
  15.     procedure Move_Start( this : access Player; dir : Cardinal_Direction ) is abstract; 
  16.  
  17.     -- Notifies the player entity that a "stop movement" impulse in direction 
  18.     -- 'dir' was received. This procedure must be overridden to provide an 
  19.     -- implementation. 
  20.     procedure Move_Stop( this : access Player; dir : Cardinal_Direction ) is abstract; 
  21.  
  22. private 
  23.  
  24.     type Player is abstract new Entity with 
  25.         record 
  26.             alive  : Boolean := True; 
  27.             moving : Direction_Booleans := Direction_Booleans'(others => False); 
  28.         end record; 
  29.  
  30.     -- Constructs the Player object. Subclass constructors should call this 
  31.     -- procedure first. 
  32.     procedure Construct( this    : access Player; 
  33.                          width, 
  34.                          height  : Natural; 
  35.                          libName : String ); 
  36.  
  37.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Player ); 
  38.     for Player'Read use Object_Read; 
  39.  
  40.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Player ); 
  41.     for Player'Write use Object_Write; 
  42.  
  43.     -- Deletes the Player. 
  44.     procedure Delete( this : in out A_Player ); 
  45.     pragma Postcondition( this = null ); 
  46.  
  47. end Entities.Players;