BcPOC
SF-HRP ASM implementation
D:/bcatch/bcpoc_src/bcpoc/src/sfhrp/SFHRP/sf_hrp_asm.hpp
Go to the documentation of this file.
00001 
00010 #ifndef _SF_HRP_ASM_H_
00011 #define _SF_HRP_ASM_H_
00012 
00013 //WTF
00014 #define null 0
00015 
00016 #include <map>
00017 #include <set>
00018 #include <vector>
00019 
00020 #include "condition.hpp"
00021 #include "sf_hrp_plan.hpp"
00022 
00026 struct CPlanComparator {
00027 
00031         bool operator()( CSFHRPPlan* a, CSFHRPPlan* b) {
00032                 return a->GetPriority() < b->GetPriority();
00033         }
00034 };
00035 
00036 
00037 
00043 class CSFHRPASM {
00044 public:
00045 
00046         /*
00047          * Ctor
00048          */
00049         CSFHRPASM(IEngineDescriptor*);
00050 
00051         /*
00052          * Dtor
00053          */
00054         ~CSFHRPASM();
00055                 
00056         void SetCondition( int, bool); //condition enum, value
00057 
00058         int GetAction(); //returns enum with valid action
00059 
00063         void Activate(CSFHRPPlan*);
00064 
00068         void Deactivate(CSFHRPPlan*);
00069 
00073         void AddPlan( CSFHRPPlan*);
00074 
00078         void AddCondition( CCondition*);
00079 
00083         void RegisterElement( int, CElement*);
00084 
00085 private:
00086 
00087         typedef         std::multimap< int, CElement*>                          elementMap;
00088         typedef         std::vector< CSFHRPPlan* >                              planVector;
00089         typedef         std::vector< CCondition* >                              conditionVector;
00090         typedef         std::set< CSFHRPPlan*, CPlanComparator >        planSet;
00091 
00097         elementMap m_conditionElements;
00098 
00102         planVector m_plans;
00103 
00107         planSet m_holding;
00108 
00112         CSFHRPPlan* m_activePlan;
00113 
00117         IEngineDescriptor* m_engine;
00118 
00123         conditionVector m_conditions;
00124 
00125 
00126 };
00127 
00128 
00129 #endif //_SF_HRP_ASM_H_