Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7035 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Feb 5, 2006, 11:26:21 PM (19 years ago)
Author:
patrick
Message:

trunk: game rules loading problems

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/class_id.h

    r7019 r7035  
    142142  CL_MULTI_PLAYER_WORLD_DATA    =    0x00000108,
    143143  CL_MOVIE_LOADER               =    0x00000109,
     144  CL_GAME_RULES                 =    0x00000110,          ///HACK: this is no story entity, bensch: to rebuild
     145  CL_MULTIPLAYER_TEAM_DEATHMATCH =   0x00000111,          ///HACK: this is no story entity: it is a CL_GAME_RULES, bensch: to rebuild
    144146
    145147  /// SUPER-PNodes
  • trunk/src/lib/graphics/graphics_engine.cc

    r7029 r7035  
    142142  LOAD_PARAM_START_CYCLE(root, element);
    143143  {
    144     PRINTF(0)("element is: %s\n", element->Value());
     144    PRINTF(4)("element is: %s\n", element->Value());
    145145    Factory::fabricate(element);
    146146  }
  • trunk/src/story_entities/game_world.cc

    r7029 r7035  
    6464#include "shader.h"
    6565
     66#include "game_rules.h"
    6667
    6768using namespace std;
     
    350351
    351352    GraphicsEngine::getInstance()->tick(this->dtS);
     353
     354    if( likely(this->dataTank->gameRule != NULL))
     355      this->dataTank->gameRule->tick(this->dtS);
    352356  }
    353357  this->lastFrame = currentFrame;
     
    437441
    438442  engine->draw();
     443
     444  // draw the game ruls
     445  if( likely(this->dataTank->gameRule != NULL))
     446    this->dataTank->gameRule->draw();
    439447}
    440448
  • trunk/src/story_entities/game_world_data.cc

    r7034 r7035  
    8383  this->music = NULL;
    8484  this->objectManager = NULL;
     85  this->gameRule = NULL;
    8586}
    8687
  • trunk/src/util/game_rules.cc

    r7020 r7035  
    2626 * constructor
    2727 */
    28 GameRules::GameRules(const TiXmlElement root)
    29 {}
     28GameRules::GameRules(const TiXmlElement* root)
     29{
     30  this->setClassID(CL_GAME_RULES, "GameRules");
     31}
    3032
    3133/**
     
    3840
    3941void GameRules::loadParams(const TiXmlElement* root)
    40 {}
     42{
     43  BaseObject::loadParams(root);
     44}
    4145
  • trunk/src/util/game_rules.h

    r7034 r7035  
    2020
    2121  public:
    22     GameRules(const TiXmlElement root);
     22    GameRules(const TiXmlElement* root);
    2323    virtual ~GameRules();
    2424
    25     virtual void loadParams(const TiXmlElement* root);
     25    virtual void loadParams(const TiXmlElement* root = NULL);
    2626
    2727
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7034 r7035  
    1818
    1919#include "load_param.h"
     20#include "factory.h"
    2021
    2122
     
    2324
    2425
     26CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
     27
     28
    2529/**
    2630 * constructor
    2731 */
    28 MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement root)
     32MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root)
    2933  : GameRules(root)
    30 {}
     34{
     35  this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
     36
     37  if( root != NULL)
     38    this->loadParams(root);
     39}
    3140
    3241/**
     
    3948
    4049void MultiplayerTeamDeathmatch::loadParams(const TiXmlElement* root)
     50{
     51  GameRules::loadParams(root);
     52}
     53
     54
     55/**
     56 * called when the player enters the game
     57 * @param player the spawned player
     58 */
     59void MultiplayerTeamDeathmatch::onPlayerSpawn(Player* player)
    4160{}
    4261
     62
     63/**
     64 * when the player is killed
     65 * @param player the killed player
     66 */
     67void MultiplayerTeamDeathmatch::onPlayerDeath(Player* player)
     68{}
     69
     70
     71/**
     72 * time tick
     73 * @param dt time
     74 */
     75void MultiplayerTeamDeathmatch::tick(float dt)
     76{}
     77
     78
     79/**
     80 * draws the stuff
     81 */
     82void MultiplayerTeamDeathmatch::draw()
     83{}
     84
     85
     86/**
     87 * check the game rules for consistency
     88 */
     89void MultiplayerTeamDeathmatch::checkGameRules()
     90{}
     91
     92
     93
     94
     95
     96
  • trunk/src/util/multiplayer_team_deathmatch.h

    r7034 r7035  
    11
    22/*!
    3  * @file game_rules.h
     3 * @file multiplayer_team_deathmatch.h
    44 * Defines game rules for this game
    55 */
     
    2020
    2121  public:
    22     MultiplayerTeamDeathmatch(const TiXmlElement root);
     22    MultiplayerTeamDeathmatch(const TiXmlElement* root = NULL);
    2323    virtual ~MultiplayerTeamDeathmatch();
    2424
     
    3535
    3636  protected:
    37     virtual void checkMultiplayerTeamDeathmatch();
     37    virtual void checkGameRules();
    3838};
    3939
Note: See TracChangeset for help on using the changeset viewer.