Changeset 2132 for code/branches/objecthierarchy/src/orxonox/objects
- Timestamp:
- Nov 4, 2008, 5:12:31 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/Test.cc
r2112 r2132 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 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 … … 60 71 { 61 72 REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) ); 62 REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) ); 63 REGISTERDATA ( v3,direction::bidirectional, new NetworkCallback<Test> ( this, &Test::checkV3 ) ); 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 -
code/branches/objecthierarchy/src/orxonox/objects/Test.h
r2112 r2132 48 48 void setV2(unsigned int value){ v2 = value; } 49 49 void setV3(unsigned int value){ v3 = value; } 50 void setV4(unsigned int value){ v4 = value; } 50 51 51 52 void checkV1(); 52 53 void checkV2(); 53 54 void checkV3(); 55 void checkV4(); 56 57 void printV1(){ instance_->checkV1(); } 58 void printV2(){ instance_->checkV2(); } 59 void printV3(){ instance_->checkV3(); } 60 void printV4(){ instance_->checkV4(); } 54 61 55 62 private: … … 57 64 unsigned int v2; 58 65 unsigned int v3; 66 unsigned int v4; 67 68 static Test* instance_; 59 69 }; 60 70 } -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/ControllableEntity.cc
r2112 r2132 250 250 REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient); 251 251 252 REGISTERDATA(this->server_overwrite_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 253 REGISTERDATA(this->client_overwrite_, direction::toserver); 254 252 255 REGISTERDATA(this->server_position_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 253 256 REGISTERDATA(this->server_velocity_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity)); 254 257 REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 255 258 256 REGISTERDATA(this->server_overwrite_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));257 REGISTERDATA(this->client_overwrite_, direction::toserver);258 259 259 REGISTERDATA(this->client_position_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 260 260 REGISTERDATA(this->client_velocity_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
Note: See TracChangeset
for help on using the changeset viewer.