home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 08 FPS, RTS, and RPG AI / 06 Alt, King / Listing2.cpp < prev   
Encoding:
C/C++ Source or Header  |  2001-12-09  |  1.1 KB  |  43 lines

  1. /* Copyright (C) Greg Alt and Kristin King, 2001. 
  2.  * All rights reserved worldwide.
  3.  *
  4.  * This software is provided "as is" without express or implied
  5.  * warranties. You may freely copy and compile this source into
  6.  * applications you distribute provided that the copyright text
  7.  * below is included in the resulting source code, for example:
  8.  * "Portions Copyright (C) Greg Alt and Kristin King, 2001"
  9.  */
  10.  
  11. // The following pseudo-code shows the main components of 
  12. // classes AIMemoryElement and AIMemory.
  13.  
  14. class AIMemoryElement
  15. {
  16. public:
  17.     AIMemoryElement(AIEvent);
  18.     EventID GetID();
  19.     int GetMagnitude();
  20.     Time GetTimeStamp();
  21.     bool Match(SubjectGrp, Magnitude, Verb, Object, ObjectIndividual);
  22.     Void Update(AIEvent);
  23.  
  24. private:
  25.     EventID id;
  26.     int Magnitude;
  27.     Time TimeStamp;
  28. };
  29.  
  30. class AIMemory
  31. {
  32. public:
  33.     bool Merge(AIMemory);
  34.     void Update(AIEvent);
  35.     void AddNewMemoryElement(AIEvent);
  36.     void ReplaceMemoryElement(AIEvent, Index);
  37.  
  38. private:
  39.     static DynamicArray<AIEvent> MasterEventList;
  40.     DynamicArray<AIMemoryElement> PerNPCLongTermMemory;
  41. };
  42.  
  43.