Changeset 9757 in orxonox.OLD for branches/new_class_id/src/lib
- Timestamp:
- Sep 18, 2006, 10:06:19 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/coord/p_node.cc
r9755 r9757 78 78 PNode::~PNode () 79 79 { 80 PRINTF( 0)("delete %s::%s\n", this->getClassCName(), this->getCName());80 PRINTF(4)("delete %s::%s\n", this->getClassCName(), this->getCName()); 81 81 this->debugNode(0); 82 82 // remove the Node, delete it's children (if required). -
branches/new_class_id/src/lib/graphics/effects/cloud_effect.cc
r9746 r9757 49 49 50 50 51 CREATE_SCRIPTABLE_CLASS(CloudEffect, CloudEffect::classID(),51 CREATE_SCRIPTABLE_CLASS(CloudEffect, 52 52 addMethod("skyColor", Executor4<CloudEffect, lua_State*,float,float,float,float>(&CloudEffect::shellSkyColor)) 53 53 ->addMethod("cloudColor", Executor4<CloudEffect, lua_State*,float,float,float,float>(&CloudEffect::shellCloudColor)) -
branches/new_class_id/src/lib/graphics/effects/fog_effect.cc
r9746 r9757 32 32 #include "class_id_DEPRECATED.h" 33 33 34 CREATE_SCRIPTABLE_CLASS(FogEffect, FogEffect::classID(),34 CREATE_SCRIPTABLE_CLASS(FogEffect, 35 35 addMethod("fadeIn", Executor0<FogEffect, lua_State*>(&FogEffect::fadeInFog)) 36 36 ->addMethod("fadeOut", Executor0<FogEffect, lua_State*>(&FogEffect::fadeOutFog)) -
branches/new_class_id/src/lib/graphics/effects/lightning_effect.cc
r9746 r9757 35 35 SHELL_COMMAND(deactivate, LightningEffect, deactivateLightning); 36 36 37 CREATE_SCRIPTABLE_CLASS(LightningEffect, LightningEffect::classID(),37 CREATE_SCRIPTABLE_CLASS(LightningEffect, 38 38 addMethod("activate", Executor0<LightningEffect, lua_State*>(&LightningEffect::activate)) 39 39 ->addMethod("deactivate", Executor0<LightningEffect, lua_State*>(&LightningEffect::deactivate)) -
branches/new_class_id/src/lib/graphics/effects/rain_effect.cc
r9746 r9757 44 44 45 45 46 CREATE_SCRIPTABLE_CLASS(RainEffect, RainEffect::classID(),46 CREATE_SCRIPTABLE_CLASS(RainEffect, 47 47 addMethod("startRaining", Executor0<RainEffect, lua_State*>(&RainEffect::startRaining)) 48 48 ->addMethod("stopRaining", Executor0<RainEffect, lua_State*>(&RainEffect::stopRaining)) -
branches/new_class_id/src/lib/graphics/effects/snow_effect.cc
r9746 r9757 37 37 38 38 39 CREATE_SCRIPTABLE_CLASS(SnowEffect, SnowEffect::classID(),39 CREATE_SCRIPTABLE_CLASS(SnowEffect, 40 40 addMethod("activate", Executor0<SnowEffect, lua_State*>(&SnowEffect::activate)) 41 41 ->addMethod("deactivate", Executor0<SnowEffect, lua_State*>(&SnowEffect::deactivate)) -
branches/new_class_id/src/lib/gui/gl/glgui_box.cc
r9715 r9757 150 150 while (itC != this->_children.end()) 151 151 { 152 if ((*itC)->isA(GLGuiContainer:: classID()))152 if ((*itC)->isA(GLGuiContainer::staticClassID())) 153 153 static_cast<GLGuiContainer*>(*itC)->showAll(); 154 154 else … … 165 165 while (itC != this->_children.end()) 166 166 { 167 if ((*itC)->isA(GLGuiContainer:: classID()))167 if ((*itC)->isA(GLGuiContainer::staticClassID())) 168 168 static_cast<GLGuiContainer*>(*itC)->hideAll(); 169 169 else -
branches/new_class_id/src/lib/gui/gl/glgui_frame.cc
r9715 r9757 71 71 if (this->child != NULL) 72 72 { 73 if (this->child->isA(GLGuiContainer:: classID()))73 if (this->child->isA(GLGuiContainer::staticClassID())) 74 74 static_cast<GLGuiContainer*>(this->child)->showAll(); 75 75 else … … 83 83 if (this->child != NULL) 84 84 { 85 if (this->child->isA(GLGuiContainer:: classID()))85 if (this->child->isA(GLGuiContainer::staticClassID())) 86 86 static_cast<GLGuiContainer*>(this->child)->hideAll(); 87 87 else -
branches/new_class_id/src/lib/lang/class_id.h
r9716 r9757 61 61 public: 62 62 /** @returns the NullClass' ID. */ 63 static const ClassID& classID() { return NullClass::_classID; }63 static const ClassID& staticClassID() { return NullClass::_classID; } 64 64 /** @param id the ID to acquire @param name the name to acquire @brief acquires the ID of this Class */ 65 65 static void acquireID(const int*& id, const std::string*& name) { id = &_nullID; name = &_nullName; }; … … 69 69 70 70 private: 71 static ClassID _classID; //!< The NullClass' ID71 static ClassID _classID; //!< The NullClass' ID 72 72 static const std::string _nullName; //!< The NullClass' Name ("NullClass") 73 73 static int _nullID; //!< The NullClass' ID -
branches/new_class_id/src/lib/lang/object_list.cc
r9726 r9757 125 125 return base->_identity; 126 126 else 127 return NullClass:: classID();127 return NullClass::staticClassID(); 128 128 } 129 129 … … 141 141 return base->_identity; 142 142 else 143 return NullClass:: classID();143 return NullClass::staticClassID(); 144 144 } 145 145 -
branches/new_class_id/src/lib/lang/object_list.h
r9726 r9757 25 25 public: \ 26 26 static inline const ObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \ 27 static inline const ClassID& classID() { return ClassName::_objectList.identity(); }; \27 static inline const ClassID& staticClassID() { return ClassName::_objectList.identity(); }; \ 28 28 private: \ 29 29 static ObjectList<ClassName> _objectList -
branches/new_class_id/src/lib/network/network_game_manager.cc
r9715 r9757 92 92 assert( SharedNetworkData::getInstance()->isMasterServer()); 93 93 assert( State::getGameRules() ); 94 assert( State::getGameRules()->isA( NetworkGameRules:: classID()) );94 assert( State::getGameRules()->isA( NetworkGameRules::staticClassID()) ); 95 95 96 96 NetworkGameRules & rules = *(dynamic_cast<NetworkGameRules*>(State::getGameRules())); … … 105 105 106 106 assert( bo != NULL ); 107 assert( bo->isA( Playable:: classID()) );107 assert( bo->isA( Playable::staticClassID()) ); 108 108 109 109 Playable & playable = *(dynamic_cast<Playable*>(bo)); … … 130 130 stats->setNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Server" ) ); 131 131 132 if ( rules.isA( MultiplayerTeamDeathmatch:: classID()) )132 if ( rules.isA( MultiplayerTeamDeathmatch::staticClassID()) ) 133 133 dynamic_cast<MultiplayerTeamDeathmatch*>(&rules)->respawnPlayable( &playable, team, 0.0f ); 134 134 … … 192 192 if ( (*it)->getUniqueID() == uniqueId ) 193 193 { 194 if ( (*it)->isA(Playable:: classID()) )194 if ( (*it)->isA(Playable::staticClassID()) ) 195 195 { 196 196 getInstance()->playablesToDelete.push_back( dynamic_cast<Playable*>(*it) ); … … 321 321 322 322 assert( State::getGameRules() ); 323 assert( State::getGameRules()->isA( NetworkGameRules:: classID()) );323 assert( State::getGameRules()->isA( NetworkGameRules::staticClassID()) ); 324 324 325 325 NetworkGameRules & rules = *(dynamic_cast<NetworkGameRules*>(State::getGameRules())); -
branches/new_class_id/src/lib/network/network_stream.cc
r9716 r9757 967 967 968 968 // if handshake not finished only sync handshake 969 if ( peer->second.handshake && Handshake:: classID() != sync.getLeafClassID())969 if ( peer->second.handshake && Handshake::staticClassID() != sync.getLeafClassID()) 970 970 continue; 971 971 … … 973 973 if ( ( SharedNetworkData::getInstance()->isMasterServer() || 974 974 SharedNetworkData::getInstance()->isProxyServerActive() && peer->second.isClient()) 975 && Handshake:: classID() == sync.getLeafClassID() && sync.getUniqueID() != peer->second.userId )975 && Handshake::staticClassID() == sync.getLeafClassID() && sync.getUniqueID() != peer->second.userId ) 976 976 continue; 977 977 978 978 /* list of synchronizeables that will never be synchronized over the network: */ 979 979 // do not sync null parent 980 if ( NullParent:: classID() == sync.getLeafClassID())980 if ( NullParent::staticClassID() == sync.getLeafClassID()) 981 981 continue; 982 982 … … 1187 1187 /* These are some small exeptions in creation: Not all objects can/should be created via Factory */ 1188 1188 /* Exception 1: NullParent */ 1189 if( NullParent:: classID() == leafClassId || Synchronizeable::classID() == leafClassId || NetworkGameManager::classID() == leafClassId)1189 if( NullParent::staticClassID() == leafClassId || Synchronizeable::staticClassID() == leafClassId || NetworkGameManager::staticClassID() == leafClassId) 1190 1190 { 1191 1191 PRINTF(1)("Don't create Object with ID %x, ignored!\n", (int)leafClassId); … … 1203 1203 } 1204 1204 1205 if ( b->isA(Synchronizeable:: classID()) )1205 if ( b->isA(Synchronizeable::staticClassID()) ) 1206 1206 { 1207 1207 sync = dynamic_cast<Synchronizeable*>(b); -
branches/new_class_id/src/lib/network/synchronizeable.cc
r9715 r9757 75 75 // remove the message manager only by the server 76 76 if ( (SharedNetworkData::getInstance()->isMasterServer() ) 77 && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( MessageManager:: classID() ) )77 && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( MessageManager::staticClassID() ) ) 78 78 NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() ); 79 79 } -
branches/new_class_id/src/lib/particles/particle_system.cc
r9727 r9757 134 134 if (emitter != NULL) 135 135 { 136 if (emitter->isA(ParticleEmitter:: classID()))136 if (emitter->isA(ParticleEmitter::staticClassID())) 137 137 this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter)); 138 138 else -
branches/new_class_id/src/lib/script_engine/script.cc
r9749 r9757 25 25 ObjectListDefinition(Script); 26 26 27 CREATE_SCRIPTABLE_CLASS(Script, Script::classID(),27 CREATE_SCRIPTABLE_CLASS(Script, 28 28 addMethod("addObject", Executor2<Script, lua_State*,const std::string&, const std::string& >(&Script::addObject)) 29 29 ->addMethod("registerClass", Executor1<Script, lua_State*,const std::string&>(&Script::registerClass)) -
branches/new_class_id/src/lib/script_engine/script_class.h
r9749 r9757 18 18 * this should be used at the beginning of all the Classes that should be loadable (in the cc-file) 19 19 */ 20 #define CREATE_SCRIPTABLE_CLASS(CLASS_NAME, CLASS_ID,SCRIPT_METHODS) \21 tScriptClass<CLASS_NAME> global_##CLASS_NAME##_ScriptableClass(#CLASS_NAME, CLASS_ ID, (new ScriptMethod)->SCRIPT_METHODS)20 #define CREATE_SCRIPTABLE_CLASS(CLASS_NAME, SCRIPT_METHODS) \ 21 tScriptClass<CLASS_NAME> global_##CLASS_NAME##_ScriptableClass(#CLASS_NAME, CLASS_NAME::staticClassID(), (new ScriptMethod)->SCRIPT_METHODS) 22 22 23 23 -
branches/new_class_id/src/lib/shell/shell_completion.cc
r9734 r9757 87 87 if (objectList != NULL) 88 88 classID = objectList->identity(); 89 if (classID != NullClass:: classID())89 if (classID != NullClass::staticClassID()) 90 90 completeType |= ObjectCompletion; 91 91 completeType |= FunctionCompletion; -
branches/new_class_id/src/lib/util/loading/factory.h
r9715 r9757 34 34 */ 35 35 #define CREATE_FACTORY(CLASS_NAME) \ 36 tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(CLASS_NAME:: classID())36 tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(CLASS_NAME::staticClassID()) 37 37 38 38 //! The Factory is a loadable object handler -
branches/new_class_id/src/lib/util/loading/fast_factory.h
r9716 r9757 39 39 */ 40 40 #define CREATE_FAST_FACTORY_STATIC(CLASS_NAME) \ 41 FastFactory* CLASS_NAME::fastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_NAME:: classID(), #CLASS_NAME)41 FastFactory* CLASS_NAME::fastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_NAME::staticClassID(), #CLASS_NAME) 42 42 43 43 //! A struct, that holds Lists of Objects of a certain type.
Note: See TracChangeset
for help on using the changeset viewer.