Colobot
Public Member Functions | List of all members
CLevelParser Class Reference

Public Member Functions

 CLevelParser ()
 Create an empty level file. More...
 
 CLevelParser (std::string filename)
 Load level from file. More...
 
bool Exists ()
 Check if level file exists. More...
 
void Load ()
 Load file. More...
 
void Save ()
 Save file. More...
 
void SetLevelPaths (LevelCategory category, int chapter=0, int rank=0)
 Configure level paths for the given level. More...
 
std::string InjectLevelPaths (const std::string &path, const std::string &defaultDir="")
 Inject something% paths. More...
 
const std::string & GetFilename ()
 Get filename. More...
 
const std::vector< CLevelParserLineUPtr > & GetLines ()
 Get all lines from file. More...
 
void AddLine (CLevelParserLineUPtr line)
 Insert new line to file. More...
 
CLevelParserLineGet (const std::string &command)
 Find first line with given command. More...
 
CLevelParserLineGetIfDefined (const std::string &command)
 Find first line with given command, null if doesn't exist. More...
 
int CountLines (const std::string &command)
 Count lines with given command. More...
 
 CLevelParser (LevelCategory category, int chapter, int rank)
 Load given level. More...
 
 CLevelParser (std::string category, int chapter, int rank)
 

Static Public Member Functions

static std::string BuildCategoryPath (LevelCategory category)
 Build category path. More...
 
static std::string BuildCategoryPath (std::string category)
 
static std::string BuildScenePath (LevelCategory category, int chapter, int rank, bool sceneFile=true)
 Build level filename. More...
 
static std::string BuildScenePath (std::string category, int chapter, int rank, bool sceneFile=true)
 

Constructor & Destructor Documentation

CLevelParser::CLevelParser ( )

Create an empty level file.

CLevelParser::CLevelParser ( std::string  filename)

Load level from file.

CLevelParser::CLevelParser ( LevelCategory  category,
int  chapter,
int  rank 
)

Load given level.

Member Function Documentation

std::string CLevelParser::BuildCategoryPath ( LevelCategory  category)
static

Build category path.

std::string CLevelParser::BuildScenePath ( LevelCategory  category,
int  chapter,
int  rank,
bool  sceneFile = true 
)
static

Build level filename.

bool CLevelParser::Exists ( )

Check if level file exists.

void CLevelParser::Load ( )

Load file.

void CLevelParser::Save ( )

Save file.

void CLevelParser::SetLevelPaths ( LevelCategory  category,
int  chapter = 0,
int  rank = 0 
)

Configure level paths for the given level.

std::string CLevelParser::InjectLevelPaths ( const std::string &  path,
const std::string &  defaultDir = "" 
)

Inject something% paths.

const std::string & CLevelParser::GetFilename ( )

Get filename.

const std::vector<CLevelParserLineUPtr>& CLevelParser::GetLines ( )
inline

Get all lines from file.

void CLevelParser::AddLine ( CLevelParserLineUPtr  line)

Insert new line to file.

CLevelParserLine * CLevelParser::Get ( const std::string &  command)

Find first line with given command.

CLevelParserLine * CLevelParser::GetIfDefined ( const std::string &  command)

Find first line with given command, null if doesn't exist.

int CLevelParser::CountLines ( const std::string &  command)

Count lines with given command.


The documentation for this class was generated from the following files: