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

  1.  
  2. #include "ierule.h"
  3. #include "iegoal.h"
  4.  
  5. IERule::IERule ( IEExec * condition )
  6. {
  7.     m_condition = condition;
  8.     m_goal      = NULL;
  9.     m_fired     = false;
  10. }
  11.  
  12. IERule::~IERule ()
  13. {
  14. }
  15.  
  16. void IERule::setGoal ( IEGoal * goal )
  17. {
  18.     m_goal = goal;
  19. }
  20.  
  21. void IERule::setGoal ( char * name, char * lineInfo )
  22. {
  23.     m_goalName = name;
  24.     m_lineInfo = lineInfo;
  25. }
  26.  
  27. IEGoal * IERule::getGoal()
  28. {
  29.     if ( m_type == IERule::Return )
  30.     {
  31.         return m_goal->m_lastGoal;
  32.     }
  33.     else
  34.     {
  35.         return m_goal;
  36.     }
  37. }
  38.  
  39. void IERule::setType ( RuleType type )
  40. {
  41.     m_type = type;
  42. }
  43.