1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. package Entities.Players is 
  10.  
  11.     type Player is abstract new Entity with private; 
  12.     type A_Player is access all Player'Class; 
  13.  
  14.     -- Notifies the player that something deadly happened to it and it should 
  15.     -- die. The player entity may choose to do nothing if it is currently 
  16.     -- invincible. This procedure must be overridden to provide an 
  17.     -- implementation. 
  18.     procedure Die( this : access Player ) is abstract; 
  19.  
  20. private 
  21.  
  22.     type Player is abstract new Entity with 
  23.         record 
  24.             alive  : Boolean := True; 
  25.             moving : Direction_Booleans := Direction_Booleans'(others => False); 
  26.         end record; 
  27.  
  28.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Player ); 
  29.     for Player'Read use Object_Read; 
  30.  
  31.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Player ); 
  32.     for Player'Write use Object_Write; 
  33.  
  34. end Entities.Players;