home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 06 General Architectures / 04 Christian / dying.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-10  |  536 b   |  40 lines

  1.  
  2. #include "character.h"
  3. #include "Dying.h"
  4. #include "gametime.h"
  5. #include "util.h"
  6.  
  7. Dying::Dying()
  8. {
  9.     m_name      = "Dying";
  10.     m_owner     = NULL;
  11. }
  12.  
  13. void Dying::init   ( IEOwner * owner )
  14. {
  15.     m_owner = dynamic_cast<Character *> (owner);
  16. }
  17.  
  18.  
  19. bool Dying::update () 
  20. {
  21.     int curHealth = m_owner->getHealth();
  22.  
  23.     if ( curHealth <= 0 )
  24.         return true;
  25.     else
  26.         return false;
  27. }
  28.  
  29.  
  30. IEOwner * Dying::getOwner ()
  31. {
  32.     return m_owner;
  33. }
  34.  
  35. const char * Dying::getName()
  36. {
  37.     return m_name.c_str();
  38. }
  39.  
  40.