Changeset 7105 for code/branches/presentation3/src/orxonox
- Timestamp:
- Jun 3, 2010, 2:24:14 AM (14 years ago)
- Location:
- code/branches/presentation3/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/Level.cc
r7036 r7105 80 80 void Level::registerVariables() 81 81 { 82 registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile)); 83 registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName)); 84 registerVariable(this->description_, VariableDirection::ToClient); 82 registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile)); 83 registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName)); 84 registerVariable(this->description_, VariableDirection::ToClient); 85 registerVariable(this->networkTemplateNames_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkCallbackTemplatesChanged)); 85 86 } 86 87 … … 97 98 98 99 Loader::open(this->xmlfile_); 100 } 101 102 void Level::networkCallbackTemplatesChanged() 103 { 104 for( std::set<std::string>::iterator it = this->networkTemplateNames_.begin(); it!=this->networkTemplateNames_.end(); ++it ) 105 { 106 assert(Template::getTemplate(*it)); 107 Template::getTemplate(*it)->applyOn(this); 108 } 99 109 } 100 110 -
code/branches/presentation3/src/orxonox/Level.h
r7039 r7105 66 66 67 67 void addLodInfo(MeshLodInformation* object); 68 void networkCallbackTemplatesChanged(); 68 69 // const MeshLodInformation* getLodInfo(std::string meshName) const; 69 70 // MeshLodInformation* getLodInfo(unsigned int index) const; -
code/branches/presentation3/src/orxonox/Test.cc
r6417 r7105 88 88 void Test::registerVariables() 89 89 { 90 registerVariable ( u1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkU1 )); 91 registerVariable ( u2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkU2 )); 92 registerVariable ( u3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true ); 93 registerVariable ( u4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true ); 90 registerVariable ( this->mySet_, VariableDirection::ToClient ); 91 92 // registerVariable ( u1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkU1 )); 93 // registerVariable ( u2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkU2 )); 94 // registerVariable ( u3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true ); 95 // registerVariable ( u4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true ); 94 96 95 registerVariable ( s1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkS1 ));96 registerVariable ( s2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkS2 ));97 registerVariable ( s3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );98 registerVariable ( s4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );97 // registerVariable ( s1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkS1 )); 98 // registerVariable ( s2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkS2 )); 99 // registerVariable ( s3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true ); 100 // registerVariable ( s4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true ); 99 101 100 registerVariable ( pointer_, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::printPointer ) );102 // registerVariable ( pointer_, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::printPointer ) ); 101 103 } 102 104 -
code/branches/presentation3/src/orxonox/Test.h
r6417 r7105 35 35 #include "tools/interfaces/Tickable.h" 36 36 37 #include <set> 37 38 38 39 typedef int TYPE; … … 78 79 void printPointer(); 79 80 80 static void printV1(){ instance_-> checkU1(); }81 static void printV2(){ instance_-> checkU2(); }81 static void printV1(){ instance_->blub(); } 82 static void printV2(){ instance_->blub2(); } 82 83 static void printV3(){ instance_->checkU3(); } 83 84 static void printV4(){ instance_->checkU4(); } … … 97 98 98 99 Test* pointer_; 100 101 std::set<uint32_t> mySet_; 99 102 100 103 static Test* instance_; 104 105 void blub() 106 { mySet_.insert(2); } 107 108 void blub2() 109 { for( std::set<uint32_t>::iterator it=mySet_.begin(); it!=mySet_.end(); ++it ) COUT(0) << *it << endl; } 101 110 }; 102 111 }
Note: See TracChangeset
for help on using the changeset viewer.