Course*CRS.* doxygen-ated.
This commit is contained in:
@@ -16,8 +16,10 @@
|
|||||||
#include "CourseUtil.h"
|
#include "CourseUtil.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
|
/** @brief Edit courses can only be so big before they are rejected. */
|
||||||
const int MAX_EDIT_COURSE_SIZE_BYTES = 32*1024; // 32KB
|
const int MAX_EDIT_COURSE_SIZE_BYTES = 32*1024; // 32KB
|
||||||
|
|
||||||
|
/** @brief The list of difficulty names for courses. */
|
||||||
const char *g_CRSDifficultyNames[] =
|
const char *g_CRSDifficultyNames[] =
|
||||||
{
|
{
|
||||||
"Beginner",
|
"Beginner",
|
||||||
@@ -28,6 +30,11 @@ const char *g_CRSDifficultyNames[] =
|
|||||||
"Edit",
|
"Edit",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the course difficulty based on the string name.
|
||||||
|
* @param s the name of the difficulty.
|
||||||
|
* @return the course difficulty.
|
||||||
|
*/
|
||||||
static CourseDifficulty CRSStringToDifficulty( const RString& s )
|
static CourseDifficulty CRSStringToDifficulty( const RString& s )
|
||||||
{
|
{
|
||||||
FOREACH_ENUM( Difficulty,i)
|
FOREACH_ENUM( Difficulty,i)
|
||||||
|
|||||||
+40
-3
@@ -1,4 +1,4 @@
|
|||||||
/* CourseLoaderCRS - Reads a Course from an .CRS file. */
|
/** @brief CourseLoaderCRS - Reads a Course from an .CRS file. */
|
||||||
|
|
||||||
#ifndef COURSE_LOADER_CRS_H
|
#ifndef COURSE_LOADER_CRS_H
|
||||||
#define COURSE_LOADER_CRS_H
|
#define COURSE_LOADER_CRS_H
|
||||||
@@ -7,19 +7,56 @@
|
|||||||
class Course;
|
class Course;
|
||||||
class MsdFile;
|
class MsdFile;
|
||||||
|
|
||||||
|
/** @brief The Course Loader handles parsing the .crs files. */
|
||||||
namespace CourseLoaderCRS
|
namespace CourseLoaderCRS
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief Attempt to load a course file from a particular path.
|
||||||
|
* @param sPath the path to the file.
|
||||||
|
* @param out the course file.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool LoadFromCRSFile( const RString &sPath, Course &out );
|
bool LoadFromCRSFile( const RString &sPath, Course &out );
|
||||||
|
/**
|
||||||
|
* @brief Attempt to load the course information from the msd context.
|
||||||
|
* @param sPath the path to the file.
|
||||||
|
* @param msd the MSD context.
|
||||||
|
* @param out the course file.
|
||||||
|
* @param bFromCache true if loading from the cache area.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool LoadFromMsd( const RString &sPath, const MsdFile &msd, Course &out, bool bFromCache );
|
bool LoadFromMsd( const RString &sPath, const MsdFile &msd, Course &out, bool bFromCache );
|
||||||
|
/**
|
||||||
|
* @brief Attempt to load the course file from the buffer.
|
||||||
|
* @param sPath the path to the file.
|
||||||
|
* @param sBuffer the path to the buffer.
|
||||||
|
* @param out the course file.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool LoadFromBuffer( const RString &sPath, const RString &sBuffer, Course &out );
|
bool LoadFromBuffer( const RString &sPath, const RString &sBuffer, Course &out );
|
||||||
|
/**
|
||||||
|
* @brief Attempt to load an edit course from the hard drive.
|
||||||
|
* @param sEditFilePath a path on the hard drive to check.
|
||||||
|
* @param slot the Profile of the user with the edit course.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool LoadEditFromFile( const RString &sEditFilePath, ProfileSlot slot );
|
bool LoadEditFromFile( const RString &sEditFilePath, ProfileSlot slot );
|
||||||
|
/**
|
||||||
|
* @brief Attempt to load an edit course from the buffer.
|
||||||
|
* @param sBuffer the path to the buffer.
|
||||||
|
* @param sPath the path to the file.
|
||||||
|
* @param slot the individual's profile.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot );
|
bool LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (c) 2001-2004 Chris Danford
|
* @file
|
||||||
|
* @author Chris Danford (c) 2001-2004
|
||||||
|
* @section LICENSE
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|||||||
@@ -7,8 +7,14 @@
|
|||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
#include "RageFileDriverMemory.h"
|
#include "RageFileDriverMemory.h"
|
||||||
|
|
||||||
|
/** @brief Load the difficulty names from CourseLoaderCRS. */
|
||||||
extern const char *g_CRSDifficultyNames[]; // in CourseLoaderCRS
|
extern const char *g_CRSDifficultyNames[]; // in CourseLoaderCRS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the string of the course difficulty.
|
||||||
|
* @param iVal the course difficulty.
|
||||||
|
* @return the string.
|
||||||
|
*/
|
||||||
static RString DifficultyToCRSString( CourseDifficulty iVal )
|
static RString DifficultyToCRSString( CourseDifficulty iVal )
|
||||||
{
|
{
|
||||||
return g_CRSDifficultyNames[iVal];
|
return g_CRSDifficultyNames[iVal];
|
||||||
|
|||||||
+29
-3
@@ -1,4 +1,4 @@
|
|||||||
/* CourseWriterCRS - Writes a Course to an .CRS file. */
|
/** @brief CourseWriterCRS - Writes a Course to an .CRS file. */
|
||||||
|
|
||||||
#ifndef COURSE_WRITER_CRS_H
|
#ifndef COURSE_WRITER_CRS_H
|
||||||
#define COURSE_WRITER_CRS_H
|
#define COURSE_WRITER_CRS_H
|
||||||
@@ -6,18 +6,44 @@
|
|||||||
class Course;
|
class Course;
|
||||||
class RageFileBasic;
|
class RageFileBasic;
|
||||||
|
|
||||||
|
/** @brief The Course Writer handles writing the .crs files. */
|
||||||
namespace CourseWriterCRS
|
namespace CourseWriterCRS
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief Write the course to a file.
|
||||||
|
* @param course the course contents.
|
||||||
|
* @param f the file being built.
|
||||||
|
* @param bSavingCache is true if cache information is being saved as well.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool Write( const Course &course, RageFileBasic &f, bool bSavingCache );
|
bool Write( const Course &course, RageFileBasic &f, bool bSavingCache );
|
||||||
|
/**
|
||||||
|
* @brief Write the course to a file.
|
||||||
|
* @param course the course contents.
|
||||||
|
* @param sPath the path to the file.
|
||||||
|
* @param bSavingCache is true if cache information is being saved as well.
|
||||||
|
* @return its success or failure.
|
||||||
|
*/
|
||||||
bool Write( const Course &course, const RString &sPath, bool bSavingCache );
|
bool Write( const Course &course, const RString &sPath, bool bSavingCache );
|
||||||
|
/**
|
||||||
|
* @brief Retrieve course information from a file for eventual writing.
|
||||||
|
* @param pCourse the course file.
|
||||||
|
* @param sOut the path to the file.
|
||||||
|
*/
|
||||||
void GetEditFileContents( const Course *pCourse, RString &sOut );
|
void GetEditFileContents( const Course *pCourse, RString &sOut );
|
||||||
|
/**
|
||||||
|
* @brief Write the custom course to the machine's hard drive.
|
||||||
|
* @param pCourse the course file.
|
||||||
|
*/
|
||||||
void WriteEditFileToMachine( const Course *pCourse );
|
void WriteEditFileToMachine( const Course *pCourse );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (c) 2001-2005 Chris Danford
|
* @file
|
||||||
|
* @author Chris Danford (c) 2001-2005
|
||||||
|
* @section LICENSE
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|||||||
Reference in New Issue
Block a user