Changeset 7204 for code/branches/consolecommands3/src/orxonox/Test.cc
- Timestamp:
- Aug 23, 2010, 1:08:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/orxonox/Test.cc
r7163 r7204 29 29 #include "core/CoreIncludes.h" 30 30 #include "core/ConfigValueIncludes.h" 31 #include "core/ ConsoleCommand.h"31 #include "core/command/ConsoleCommand.h" 32 32 #include "network/NetworkFunction.h" 33 33 #include "Test.h" … … 37 37 { 38 38 CreateFactory ( Test ); 39 39 40 40 SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User); 41 41 SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User); … … 44 44 SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User); 45 45 SetConsoleCommand(Test, call2, true).accessLevel(AccessLevel::User); 46 47 46 47 48 48 //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 ); 49 49 //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a)); 50 50 // NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER ); 51 51 52 52 registerStaticNetworkFunction( &Test::printV1 ); 53 53 registerMemberNetworkFunction( Test, checkU1 ); 54 54 registerMemberNetworkFunction( Test, printBlaBla ); 55 55 56 56 Test* Test::instance_ = 0; 57 57 … … 78 78 SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/; 79 79 SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/; 80 80 81 81 SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/; 82 82 SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/; … … 89 89 { 90 90 registerVariable ( this->mySet_, VariableDirection::ToClient ); 91 91 92 92 // registerVariable ( u1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkU1 )); 93 93 // registerVariable ( u2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkU2 )); 94 94 // registerVariable ( u3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true ); 95 95 // registerVariable ( u4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true ); 96 96 97 97 // registerVariable ( s1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkS1 )); 98 98 // registerVariable ( s2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkS2 )); 99 99 // registerVariable ( s3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true ); 100 100 // registerVariable ( s4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true ); 101 101 102 102 // registerVariable ( pointer_, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::printPointer ) ); 103 103 } 104 104 105 105 void Test::call(unsigned int clientID) 106 106 { … … 108 108 callStaticNetworkFunction( &Test::printV1, clientID ); 109 109 } 110 110 111 111 void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4) 112 112 { 113 113 callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 ); 114 114 } 115 115 116 116 void Test::tick(float dt) 117 117 { … … 132 132 // callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 ); 133 133 } 134 134 135 135 void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5) 136 136 { 137 137 COUT(0) << s1 << s2 << s3 << s4 << s5 << endl; 138 138 } 139 139 140 140 void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; } 141 141 void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; } … … 147 147 void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; } 148 148 void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; } 149 149 150 150 void Test::printPointer(){ CCOUT(1) << "pointer: " << this->pointer_ << endl; } 151 151
Note: See TracChangeset
for help on using the changeset viewer.