Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2009, 1:32:40 PM (15 years ago)
Author:
rgrieder
Message:

Moved Game::getLevel to LevelManager::getStartLevel and Game::setLevel to LevelManager::setStartLevel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/LevelManager.cc

    r3196 r3245  
    3030
    3131#include <map>
     32
     33#include "core/CommandLine.h"
     34#include "core/ConfigValueIncludes.h"
     35#include "core/CoreIncludes.h"
    3236#include "PlayerManager.h"
    3337#include "objects/Level.h"
     
    4246        assert(singletonRef_s == 0);
    4347        singletonRef_s = this;
     48
     49        RegisterRootObject(LevelManager);
     50        this->setConfigValues();
     51
     52        // check override
     53        if (!CommandLine::getArgument("level")->hasDefaultValue())
     54        {
     55            ModifyConfigValue(startLevelName_, tset, CommandLine::getValue("mediaPath").getString());
     56        }
    4457    }
    4558
     
    4861        assert(singletonRef_s != 0);
    4962        singletonRef_s = 0;
     63    }
     64
     65    void LevelManager::setConfigValues()
     66    {
     67        SetConfigValue(startLevelName_, "presentation_dm.oxw")
     68            .description("Sets the preselection of the level in the main menu.");
    5069    }
    5170
     
    93112        }
    94113    }
     114
     115    void LevelManager::setStartLevel(const std::string& levelName)
     116    {
     117        ModifyConfigValue(startLevelName_, set, levelName);
     118    }
     119
     120    const std::string& LevelManager::getStartLevel()
     121    {
     122        return startLevelName_;
     123    }
    95124}
Note: See TracChangeset for help on using the changeset viewer.