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.Little_Keen is 
  10.  
  11.     pragma Elaborate_Body; 
  12.  
  13.     type Little_Keen is new Player with private; 
  14.     type A_Little_Keen is access all Little_Keen'Class; 
  15.  
  16.     -- Accelerates Keen in the direction 'dir'. 
  17.     procedure Move_Start( this : access Little_Keen; dir : Cardinal_Direction ); 
  18.  
  19.     -- Stops Keen's acceleration in the direction 'dir'. 
  20.     procedure Move_Stop( this : access Little_Keen; dir : Cardinal_Direction ); 
  21.  
  22. private 
  23.  
  24.     type Action_Type is (Act_Walking, Act_Swimming, Act_Idle); 
  25.  
  26.     type Little_Keen is new Player with 
  27.         record 
  28.             action         : Action_Type := Act_Walking; 
  29.             actionStart    : Time_Span := Time_Span_Zero; 
  30.             actionDuration : Time_Span := Time_Span_Zero; 
  31.             idleStart      : Time_Span := Time_Span_Zero; 
  32.  
  33.             -- ** these fields do not need to be streamed ** 
  34.  
  35.             upTime : Time_Span := Time_Span_Zero; 
  36.  
  37.             walkSpeed, 
  38.             walkAcceleration : Float := 0.0; 
  39.         end record; 
  40.  
  41.     procedure Construct( this : access Little_Keen ); 
  42.  
  43.     procedure Die( this : access Little_Keen ); 
  44.  
  45.     procedure Face( this : access Little_Keen; dir : Direction_Type ); 
  46.  
  47.     function Object_Input( stream : access Root_Stream_Type'Class ) return Little_Keen; 
  48.     for Little_Keen'Input use Object_Input; 
  49.  
  50.     procedure Object_Read( stream : access Root_Stream_Type'Class; obj : out Little_Keen ); 
  51.     for Little_Keen'Read use Object_Read; 
  52.  
  53.     procedure Object_Write( stream : access Root_Stream_Type'Class; obj : Little_Keen ); 
  54.     for Little_Keen'Write use Object_Write; 
  55.  
  56.     procedure Tick( this : access Little_Keen; time : Tick_Time ); 
  57.  
  58.     procedure Update_Frame( this : access Little_Keen; notify : Boolean := True ); 
  59.  
  60. end Entities.Players.Little_Keen;