Changeset 2171 for code/trunk/src/orxonox/objects/Test.cc
- Timestamp:
- Nov 10, 2008, 12:05:03 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/objecthierarchy merged: 2111-2115,2123,2132-2134,2143-2144,2153-2158,2160-2169
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/Test.cc
r2087 r2171 30 30 #include "core/CoreIncludes.h" 31 31 #include "core/ConfigValueIncludes.h" 32 #include "core/ConsoleCommand.h" 32 33 #include "Test.h" 33 34 … … 35 36 { 36 37 CreateFactory ( Test ); 38 39 SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User); 40 SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User); 41 SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User); 42 SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User); 43 44 Test* Test::instance_ = 0; 37 45 38 Test::Test(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)46 Test::Test(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) 39 47 { 48 assert(instance_==0); 49 instance_=this; 40 50 RegisterObject ( Test ); 41 42 51 setConfigValues(); 52 registerVariables(); 43 53 setObjectMode(0x3); 44 54 } … … 46 56 Test::~Test() 47 57 { 48 58 instance_=0; 49 59 } 50 60 51 61 void Test::setConfigValues() 52 62 { 53 SetConfigValue ( v1, 1 ).callback ( this, &Test::checkV1 ); 54 SetConfigValue ( v2, 2 ).callback ( this, &Test::checkV2 ); 55 SetConfigValue ( v3, 3 ).callback ( this, &Test::checkV3 ); 63 SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/; 64 SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/; 65 SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/; 66 SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/; 56 67 } 57 68 … … 59 70 void Test::registerVariables() 60 71 { 61 REGISTERDATA ( v1,network::direction::toclient, new network::NetworkCallback<Test> ( this, &Test::checkV1 ) ); 62 REGISTERDATA ( v2,network::direction::toserver, new network::NetworkCallback<Test> ( this, &Test::checkV2 ) ); 63 REGISTERDATA ( v3,network::direction::bidirectional, new network::NetworkCallback<Test> ( this, &Test::checkV3 ) ); 72 REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) ); 73 REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) ); 74 REGISTERDATA ( v3,direction::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ) ); 75 REGISTERDATA ( v4,direction::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ) ); 64 76 } 65 77 66 67 68 78 void Test::checkV1(){ 79 COUT(1) << "V1 changed: " << v1 << std::endl; 80 } 69 81 70 71 72 82 void Test::checkV2(){ 83 COUT(1) << "V2 changed: " << v2 << std::endl; 84 } 73 85 74 void Test::checkV3(){ 75 COUT(1) << "V3 changed: " << v3 << std::endl; 76 } 86 void Test::checkV3(){ 87 COUT(1) << "V3 changed: " << v3 << std::endl; 88 } 89 90 void Test::checkV4(){ 91 COUT(1) << "V4 changed: " << v4 << std::endl; 92 } 77 93 78 94
Note: See TracChangeset
for help on using the changeset viewer.