- Timestamp:
- Aug 25, 2006, 12:22:50 PM (18 years ago)
- Location:
- branches/new_class_id/src/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/util/game_rules.cc
r9494 r9704 28 28 29 29 30 30 NewObjectListDefinition(GameRules); 31 31 32 32 /** … … 35 35 GameRules::GameRules(const TiXmlElement* root) 36 36 { 37 this-> setClassID(CL_GAME_RULES, "GameRules");37 this->registerObject(this, GameRules::_objectList); 38 38 } 39 39 -
branches/new_class_id/src/util/game_rules.h
r9008 r9704 23 23 class GameRules : virtual public BaseObject 24 24 { 25 NewObjectListDeclaration(GameRules); 25 26 26 27 public: -
branches/new_class_id/src/util/multiplayer_team_deathmatch.cc
r9656 r9704 24 24 #include "render2D/image_plane.h" 25 25 #include "state.h" 26 #include "class_list.h"27 26 28 27 #include "player.h" … … 33 32 #include "shared_network_data.h" 34 33 #include "terrain.h" 35 #include "class_list.h"36 34 #include "space_ships/space_ship.h" 37 35 … … 50 48 51 49 52 50 #include "class_id.h" 53 51 54 52 CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH); 55 56 53 NewObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH); 57 54 /** 58 55 * constructor … … 61 58 : NetworkGameRules(root) 62 59 { 63 this-> setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");60 this->registerObject(this, MultiplayerTeamDeathmatch::_objectList); 64 61 65 62 this->bLocalPlayerDead = false; … … 305 302 } 306 303 307 ClassID MultiplayerTeamDeathmatch::getPlayableClassId( int userId, int team )304 NewClassID MultiplayerTeamDeathmatch::getPlayableClassId( int userId, int team ) 308 305 { 309 306 if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR ) -
branches/new_class_id/src/util/multiplayer_team_deathmatch.h
r9691 r9704 30 30 class MultiplayerTeamDeathmatch : public NetworkGameRules, public EventListener 31 31 { 32 NewObjectListDeclaration(MultiplayerTeamDeathmatch); 32 33 33 34 public: … … 38 39 39 40 virtual int getTeamForNewUser(); 40 virtual const NewClassID&getPlayableClassId( int userId, int team );41 virtual NewClassID getPlayableClassId( int userId, int team ); 41 42 virtual std::string getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId ); 42 43 virtual std::string getPlayableModelFileName( int userId, int team, const NewClassID& classId ); -
branches/new_class_id/src/util/network_game_rules.cc
r9406 r9704 22 22 23 23 24 NewObjectListDefinition(NetworkGameRules); 24 25 25 26 /** … … 27 28 */ 28 29 NetworkGameRules::NetworkGameRules ( const TiXmlElement* root ) 29 : GameRules( root )30 : GameRules( root ) 30 31 { 31 this-> setClassID( CL_NETWORK_GAME_RULES, "NetworkGameRules");32 this->registerObject(this, NetworkGameRules::_objectList); 32 33 } 33 34 … … 37 38 */ 38 39 NetworkGameRules::~NetworkGameRules () 39 { 40 } 40 {} 41 41 42 42 43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassIDclassId )43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId ) 44 44 { 45 45 return ""; 46 46 } 47 47 48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassIDclassId )48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, const NewClassID& classId ) 49 49 { 50 50 return "models/ships/reap_#.obj"; 51 51 } 52 52 53 ClassID NetworkGameRules::getPlayableClassId( int userId, int team )53 NewClassID NetworkGameRules::getPlayableClassId( int userId, int team ) 54 54 { 55 return CL_SPACE_SHIP; 55 const NewObjectListBase* objList = NewObjectListBase::getObjectList("SpaceShip"); 56 if (objList != NULL) 57 return objList->identity(); 58 else 59 return NewClassID(); 56 60 } 57 61 … … 68 72 69 73 70 float NetworkGameRules::getPlayableScale( int userId, int team, ClassIDclassId )74 float NetworkGameRules::getPlayableScale( int userId, int team, const NewClassID& classId ) 71 75 { 72 76 return 1.0f; -
branches/new_class_id/src/util/network_game_rules.h
r9691 r9704 15 15 class NetworkGameRules : public GameRules 16 16 { 17 NewObjectListDeclaration(NetworkGameRules); 17 18 18 19 public: … … 21 22 22 23 virtual int getTeamForNewUser(); 23 virtual const NewClassID&getPlayableClassId( int userId, int team );24 virtual NewClassID getPlayableClassId( int userId, int team ); 24 25 virtual std::string getPlayableModelFileName( int userId, int team, const NewClassID& classId ); 25 26 virtual std::string getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId );
Note: See TracChangeset
for help on using the changeset viewer.