Changeset 977
- Timestamp:
- Apr 3, 2008, 2:12:10 PM (17 years ago)
- Location:
- code/branches/network
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/TODO
r974 r977 2 2 3 3 network: 4 -handle variables of Spaceship (registerAllVariables) 5 -make NPC class synchronisable 6 -make Ambient class synchronisable 4 -handle variables of Spaceship (registerAllVariables) ------ wait for spaceship to be cleaned up 5 -make NPC class synchronisable ----- hopefully done 6 -make Ambient class synchronisable ----- hopefully done 7 7 -make Skybox class synchronisable ----- mostly done -
code/branches/network/src/orxonox/objects/Ambient.cc
r871 r977 51 51 { 52 52 RegisterObject(Ambient); 53 registerAllVariables(); 53 54 } 54 55 … … 57 58 } 58 59 60 bool Ambient::create(){ 61 Orxonox::getSingleton()->getSceneManager()->setAmbientLight(ambientLight_); 62 return true; 63 } 64 65 void Ambient::registerAllVariables(){ 66 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA); 67 68 } 69 59 70 void Ambient::loadParams(TiXmlElement* xmlElem) 60 71 { … … 76 87 void Ambient::setAmbientLight(const ColourValue& colour) 77 88 { 78 Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour);89 ambientLight_=colour; 79 90 } 80 91 … … 90 101 91 102 XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading); 103 create(); 92 104 } 93 105 } -
code/branches/network/src/orxonox/objects/Ambient.h
r871 r977 5 5 6 6 #include "core/BaseObject.h" 7 #include "network/Synchronisable.h" 7 8 8 9 namespace orxonox 9 10 { 10 class _OrxonoxExport Ambient : public BaseObject 11 class _OrxonoxExport Ambient : public BaseObject, network::Synchronisable 11 12 { 12 13 public: … … 17 18 virtual void XMLPort(Element& xmlelement, bool loading); 18 19 void setAmbientLight(const ColourValue& colour); 20 bool create(); 21 void registerAllVariables(); 19 22 20 23 private: 21 24 ColourValue ambientLight_; 22 25 23 26 }; -
code/branches/network/src/orxonox/objects/NPC.cc
r919 r977 39 39 RegisterObject(NPC); 40 40 movable_ = true; 41 registerAllVariables(); 41 42 } 42 43 … … 58 59 this->translate(location); 59 60 movable_ = movable; 61 } 62 63 void NPC::registerAllVariables(){ 64 Model::registerAllVariables(); 65 registerVar(&movable_, sizeof(movable_), network::DATA); 66 } 67 68 bool NPC::create(){ 69 Model::create(); 70 return true; 60 71 } 61 72 -
code/branches/network/src/orxonox/objects/NPC.h
r871 r977 26 26 void update(); 27 27 void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable); 28 void registerAllVariables(); 29 bool create(); 28 30 29 31 private: -
code/branches/network/src/orxonox/objects/Skybox.cc
r974 r977 72 72 } 73 73 74 void Skybox::setSkyboxSrc(std::string src){ 75 skyboxSrc_ = src; 76 } 77 74 78 /** 75 79 @brief XML loading and saving. … … 82 86 BaseObject::XMLPort(xmlelement, loading); 83 87 84 XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading); 88 XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, loading); 89 create(); 85 90 } 86 91 -
code/branches/network/src/orxonox/objects/Skybox.h
r974 r977 23 23 bool create(); 24 24 void registerAllVariables(); 25 void setSkyboxSrc(std::string src); 25 26 26 27 private: -
code/branches/network/src/orxonox/objects/WorldEntity.cc
r974 r977 190 190 191 191 XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading); 192 193 //create(); 192 194 } 193 195
Note: See TracChangeset
for help on using the changeset viewer.