00001 #ifndef OBSERVER_H 00002 #define OBSERVER_H 00003 00010 #include <list> 00011 #include <iostream> 00012 #include <vector> 00013 00014 #include "mainplansys.h" 00015 00016 00017 00018 using namespace std; 00019 00020 class Subject; 00021 00022 class Observer { 00023 00024 public: 00025 Observer( ); 00026 ~Observer(); 00027 virtual void Update(Subject* theChangeSubject, int typeOfObservation) = 0; 00028 virtual int GetPriority() = 0; 00029 virtual int AgentGlobalPriority() = 0; 00030 virtual int GetAction( controll_struct *ai_controll_struct ) = 0; 00031 virtual int SetAgentActive( int active ) = 0; 00032 virtual int StrategyInterrupted() = 0; 00033 virtual int GetInterruptAction(interrupt_controll_struct *interrupt_controll) = 0; 00034 int teamColor; 00035 00036 private: 00037 00038 00039 }; 00040 00041 class Subject { 00042 public: 00043 Subject() {}; 00044 ~Subject() {}; 00045 void Attach( Observer* ); 00046 void Detach( Observer* ); 00047 void Notify(int typeOfObservation); 00048 vector<Observer *> _observers; 00049 private: 00050 00051 protected: 00052 00053 00054 }; 00055 00056 00057 #endif