home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 06 General Architectures / 04 Christian / ie.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-10  |  1.2 KB  |  56 lines

  1.  
  2. #ifndef _IE_H_
  3. #define _IE_H_
  4.  
  5. #include <stack>
  6. #include <string>
  7. #include <list>
  8.  
  9. class IEGoal;
  10. class IEExec;
  11. class IERule;
  12. class IEOwner;
  13.  
  14. class IE
  15. {
  16.  
  17. public:
  18.  
  19.     void start          ( char   * name, IEOwner * owner );
  20.     void end            ();
  21.     void makeGoal       ( IEExec * goalExec );
  22.     void makeRule       ( IEExec * condition, char * lineInfo );
  23.     void addRuleGoto    ( char   * goalName,  char * lineInfo );
  24.     void addRuleGosub   ( char   * goalName,  char * lineInfo );
  25.     void addRuleReturn  ( char * lineInfo );
  26.  
  27.     void update         ();
  28.     void checkStart     ();
  29.     bool checkFinish    ();
  30.  
  31. private:
  32.  
  33.     bool        noRule          ( char * lineInfo );
  34.     void        linkRuleGoals   ();
  35.     IEGoal    * findGoal        ( std::string & goalName );
  36.  
  37.     void pushGoal  ( IEGoal * goal );
  38.     void popGoal   ( IEGoal * goal );
  39.     
  40. private:
  41.  
  42.     std::string           m_name;
  43.     int                   m_type;
  44.  
  45.     IEGoal              * m_curGoal;
  46.     IERule              * m_curRule;
  47.     IEGoal              * m_nextGoal;
  48.  
  49.     std::list<IEGoal *>   m_goalList;
  50.     std::list<IEGoal *>   m_goalStack;
  51.  
  52.     IEOwner             * m_owner;
  53. };
  54.  
  55. #endif
  56.