00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "stdafx.h"
00024 #include "VTPlayerInputAgent.h"
00025
00026 VTPlayerInputAgent::VTPlayerInputAgent()
00027 {
00028 bindMessage( "^IN VTP : pos=\\((.*), (.*)\\);$", BUS_CALLBACK_OF(VTPlayerInputAgent, handleInputCoord ));
00029 bindMessage( "^IN VTP : press=\\((.*)\\);$", BUS_CALLBACK_OF(VTPlayerInputAgent, handleInputPressButton ));
00030 bindMessage( "^IN VTP : release=\\((.*)\\);$", BUS_CALLBACK_OF(VTPlayerInputAgent, handleInputReleaseButton ));
00031 }
00032
00033 VTPlayerInputAgent::~VTPlayerInputAgent()
00034 {
00035 }
00036
00037 void VTPlayerInputAgent::handleInputCoord ( MicoleBus *app, int argc, const char **argv )
00038 {
00039 if (argc>=2)
00040 {
00041 int x = atoi(argv[0]);
00042 int y = atoi(argv[1]);
00043 onMove(x,y);
00044 }
00045 }
00046
00047 void VTPlayerInputAgent::handleInputPressButton ( MicoleBus *app, int argc, const char **argv )
00048 {
00049 if (argc>=1)
00050 {
00051 int button = atoi(argv[0]);
00052 onButtonDown(button);
00053 }
00054 }
00055
00056 void VTPlayerInputAgent::handleInputReleaseButton ( MicoleBus *app, int argc, const char **argv )
00057 {
00058 if (argc>=1)
00059 {
00060 int button = atoi(argv[0]);
00061 onButtonUp(button);
00062 }
00063 }
00064
00065
00066
00067 void VTPlayerInputAgent::onMove(const int &posx, const int &posy)
00068 {
00069 }
00070
00071 void VTPlayerInputAgent::onButtonDown(const int &button)
00072 {
00073 }
00074
00075 void VTPlayerInputAgent::onButtonUp(const int &button)
00076 {
00077 }