Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3238 in orxonox.OLD for orxonox/branches/nico/src/game_loader.cc


Ignore:
Timestamp:
Dec 20, 2004, 2:42:54 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches: updated branches: buerli, nico, sound. And moved bezierTrack to old.bezierTrack. Conflicts resolved in a usefull order.
Conflics mostly resolved in favor of trunk
merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/nico/src/game_loader.cc

    r2636 r3238  
    4242
    4343
     44/**
     45   \brief this class is a singleton class
     46   \returns an instance of itself
     47
     48   if you are unsure about singleton classes, check the theory out on the internet :)
     49*/
    4450GameLoader* GameLoader::getInstance()
    4551{
     
    5056
    5157
    52 Error GameLoader::init()
     58ErrorMessage GameLoader::init()
    5359{
    5460  if(this->currentCampaign != NULL)
     
    5763
    5864
    59 Error GameLoader::loadCampaign(char* name)
    60 {
    61   Error errorCode;
     65/**
     66   \brief reads a campaign definition file into a campaign class
     67   \param filename to be loaded
     68   \returns the loaded campaign
     69
     70   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
     71*/
     72ErrorMessage GameLoader::loadCampaign(char* name)
     73{
     74  ErrorMessage errorCode;
    6275 
    6376  this->currentCampaign = this->fileToCampaign(name);
    6477}
    6578
    66 Error GameLoader::loadDebugCampaign(Uint32 campaignID)
     79
     80/**
     81   \brief loads a debug campaign for test purposes only.
     82   \param the identifier of the campaign.
     83   \returns error message if not able to do so.
     84*/
     85ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID)
    6786{
    6887  switch(campaignID)
     
    7291      {
    7392        Campaign* debugCampaign = new Campaign();
     93
    7494        World* world0 = new World(DEBUG_WORLD_0);
    75         world0->setNextStoryID(DEBUG_WORLD_1);
     95        world0->setNextStoryID(WORLD_ID_1);
    7696        debugCampaign->addEntity(world0, WORLD_ID_0);
     97
    7798        World* world1 = new World(DEBUG_WORLD_1);
    7899        world1->setNextStoryID(WORLD_ID_GAMEEND);
     
    85106}
    86107
    87 Error GameLoader::start()
     108ErrorMessage GameLoader::start()
    88109{
    89110  if(this->currentCampaign != NULL)
     
    92113
    93114
    94 Error GameLoader::stop()
     115ErrorMessage GameLoader::stop()
    95116{
    96117  if(this->currentCampaign != NULL)
     
    100121
    101122
    102 Error GameLoader::pause()
     123ErrorMessage GameLoader::pause()
    103124{
    104125  this->isPaused = true;
     
    108129
    109130
    110 Error GameLoader::resume()
     131ErrorMessage GameLoader::resume()
    111132{
    112133  this->isPaused = false;
     
    115136}
    116137
    117 Error GameLoader::free()
     138/**
     139   \brief release the mem
     140 */
     141ErrorMessage GameLoader::destroy()
    118142{}
    119143
    120144
    121 
    122 
    123 
     145/**
     146   \brief reads a campaign definition file into a campaign class
     147   \param filename to be loaded
     148   \returns the loaded campaign
     149
     150   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
     151*/
    124152Campaign* GameLoader::fileToCampaign(char *name)
    125153{
     
    134162   \brief handle keyboard commands
    135163   \param cmd: the command to handle
    136    \return true if the command was handled by the system
     164   \returns true if the command was handled by the system
    137165*/
    138166bool GameLoader::worldCommand (Command* cmd)
     
    165193      return true;
    166194    }
     195  else if( !strcmp( cmd->cmd, "quit"))
     196    {
     197      if( !cmd->bUp) this->stop();
     198      return true;
     199    }
    167200  return false;
    168201}
    169202
     203
     204/*
     205  \brief this changes to the next level
     206*/
    170207void GameLoader::nextLevel()
    171208{
     
    174211}
    175212
     213
     214/*
     215  \brief change to the previous level - not implemented
     216
     217  this propably useless
     218*/
    176219void GameLoader::previousLevel()
    177220{
Note: See TracChangeset for help on using the changeset viewer.