00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TG_CONTROLLER_H
00019 #define TG_CONTROLLER_H
00020
00021 #include "Action.h"
00022
00023 namespace tagGame
00024 {
00025 class Perception;
00026 class Action;
00027 class Controller;
00028
00029 typedef SharedPtr<Perception>::type PerceptionPtr;
00030 typedef SharedPtr<Controller>::type ControllerPtr;
00031
00033 class Controller
00034 {
00035 public:
00036 inline Controller(PerceptionPtr perception);
00037 inline virtual ~Controller();
00038
00040 virtual void calcAction() = 0;
00042 inline Action const& getAction();
00044 inline void setAction(Action const& action);
00046 inline PerceptionPtr getPerception();
00050 inline void setPerception(PerceptionPtr perception);
00051 protected:
00052
00053 PerceptionPtr perception;
00054
00055 Action action;
00056 private:
00057 };
00058
00059 Controller::Controller(PerceptionPtr perception) :
00060 perception(perception)
00061 {
00062 }
00063
00064 Controller::~Controller()
00065 {
00066 }
00067
00068 Action const& Controller::getAction()
00069 {
00070 return this->action;
00071 }
00072
00073 void Controller::setAction(Action const& action)
00074 {
00075 this->action = action;
00076 }
00077
00078 PerceptionPtr Controller::getPerception()
00079 {
00080 return perception;
00081 }
00082
00083 void Controller::setPerception(PerceptionPtr perception)
00084 {
00085 this->perception = perception;
00086 }
00087 }
00088
00089 #endif