Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9704 in orxonox.OLD for branches


Ignore:
Timestamp:
Aug 25, 2006, 12:22:50 PM (18 years ago)
Author:
bensch
Message:

adapted some game-rules

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  
    2828
    2929
    30 
     30NewObjectListDefinition(GameRules);
    3131
    3232/**
     
    3535GameRules::GameRules(const TiXmlElement* root)
    3636{
    37   this->setClassID(CL_GAME_RULES, "GameRules");
     37  this->registerObject(this, GameRules::_objectList);
    3838}
    3939
  • branches/new_class_id/src/util/game_rules.h

    r9008 r9704  
    2323class GameRules : virtual public BaseObject
    2424{
     25  NewObjectListDeclaration(GameRules);
    2526
    2627  public:
  • branches/new_class_id/src/util/multiplayer_team_deathmatch.cc

    r9656 r9704  
    2424#include "render2D/image_plane.h"
    2525#include "state.h"
    26 #include "class_list.h"
    2726
    2827#include "player.h"
     
    3332#include "shared_network_data.h"
    3433#include "terrain.h"
    35 #include "class_list.h"
    3634#include "space_ships/space_ship.h"
    3735
     
    5048
    5149
    52 
     50#include "class_id.h"
    5351
    5452CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
    55 
    56 
     53NewObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
    5754/**
    5855 * constructor
     
    6158  : NetworkGameRules(root)
    6259{
    63   this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
     60  this->registerObject(this, MultiplayerTeamDeathmatch::_objectList);
    6461
    6562  this->bLocalPlayerDead = false;
     
    305302}
    306303
    307 ClassID MultiplayerTeamDeathmatch::getPlayableClassId( int userId, int team )
     304NewClassID MultiplayerTeamDeathmatch::getPlayableClassId( int userId, int team )
    308305{
    309306  if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR )
  • branches/new_class_id/src/util/multiplayer_team_deathmatch.h

    r9691 r9704  
    3030class MultiplayerTeamDeathmatch : public NetworkGameRules, public EventListener
    3131{
     32  NewObjectListDeclaration(MultiplayerTeamDeathmatch);
    3233
    3334  public:
     
    3839
    3940    virtual int getTeamForNewUser();
    40     virtual const NewClassID& getPlayableClassId( int userId, int team );
     41    virtual NewClassID getPlayableClassId( int userId, int team );
    4142    virtual std::string getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId );
    4243    virtual std::string getPlayableModelFileName( int userId, int team, const NewClassID& classId );
  • branches/new_class_id/src/util/network_game_rules.cc

    r9406 r9704  
    2222
    2323
     24NewObjectListDefinition(NetworkGameRules);
    2425
    2526/**
     
    2728 */
    2829NetworkGameRules::NetworkGameRules ( const TiXmlElement* root )
    29   : GameRules( root )
     30    : GameRules( root )
    3031{
    31   this->setClassID( CL_NETWORK_GAME_RULES, "NetworkGameRules");
     32  this->registerObject(this, NetworkGameRules::_objectList);
    3233}
    3334
     
    3738 */
    3839NetworkGameRules::~NetworkGameRules ()
    39 {
    40 }
     40{}
    4141
    4242
    43 std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
     43std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId )
    4444{
    4545  return "";
    4646}
    4747
    48 std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassID classId )
     48std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, const NewClassID& classId )
    4949{
    5050  return "models/ships/reap_#.obj";
    5151}
    5252
    53 ClassID NetworkGameRules::getPlayableClassId( int userId, int team )
     53NewClassID NetworkGameRules::getPlayableClassId( int userId, int team )
    5454{
    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();
    5660}
    5761
     
    6872
    6973
    70 float NetworkGameRules::getPlayableScale( int userId, int team, ClassID classId )
     74float NetworkGameRules::getPlayableScale( int userId, int team, const NewClassID& classId )
    7175{
    7276  return 1.0f;
  • branches/new_class_id/src/util/network_game_rules.h

    r9691 r9704  
    1515class NetworkGameRules : public GameRules
    1616{
     17  NewObjectListDeclaration(NetworkGameRules);
    1718
    1819  public:
     
    2122
    2223    virtual int getTeamForNewUser();
    23     virtual const NewClassID& getPlayableClassId( int userId, int team );
     24    virtual NewClassID getPlayableClassId( int userId, int team );
    2425    virtual std::string getPlayableModelFileName( int userId, int team, const NewClassID& classId );
    2526    virtual std::string getPlayableModelTextureFileName( int userId, int team, const NewClassID& classId );
Note: See TracChangeset for help on using the changeset viewer.