00001 #ifndef EVOLUTIONCOMPONENT_H_
00002 #define EVOLUTIONCOMPONENT_H_
00003
00004
00005
00006 #include <controllers/externalControllers/tcpip/tcpipComponent.h>
00007
00008 namespace srAlmende {
00009
00022 class EvolutionComponent : public srExternal::TcpipComponent {
00023 public:
00024 static const unsigned char TCPIP_POSITION = 10;
00025 static const unsigned char TCPIP_ORIENTATION = 11;
00026 static const unsigned char TCPIP_FITNESS = 12;
00027 static const unsigned char TCPIP_SENSOR = 13;
00028 static const unsigned char TCPIP_ACTUATOR = 14;
00029
00031 EvolutionComponent(const std::string &name, int tcpPort);
00032
00034 void ProcessMessage(const dtGame::Message &message);
00035
00037 ~EvolutionComponent();
00038
00039 protected:
00040
00041 private:
00042
00043 void sendMessageToAll(dtDAL::GameEvent &event);
00044
00045 void sendMessageToRobot(dtDAL::GameEvent &event, unsigned int robotID);
00046
00047 unsigned char TransformMessageType(srExternal::NonEmulationMessageType::msgType type);
00048
00049 srExternal::NonEmulationMessageType::msgType TransformMessageType(unsigned char type);
00050
00051 dtCore::UniqueId* TransformId(unsigned char id);
00052
00053 unsigned char TransformId(dtCore::UniqueId* id);
00054
00055 unsigned char SendBack(srExternal::NonEmulationMessageType::msgType type);
00056 };
00057
00058
00059 }
00060
00061
00062 #endif