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

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