Rearranged profile initializations and verified that all init correctly

This commit is contained in:
GPayne
2021-09-12 21:05:00 -06:00
parent 284c68f952
commit 51f6c9d45b
17 changed files with 231 additions and 683 deletions

View File

@@ -168,152 +168,6 @@ public:
std::string assetFileExtension = ".asset";
};
/**
* Function to convert a profile into separate files with converted asset contents
* from each section
*
* \param filePre The prefix name for the asset section to be applied to the output
* filename. The pattern is "<filePre>_<profilePrefix>.asset"
* \param p The profile that should be processed
*/
void convertToSeparatedAssets(const std::string filePre, const Profile& p);
/**
* Function to convert a specific section of a profile into an asset file, which allows
* that section to be individually loaded.
*
* \param profilePrefix The name for the asset section to be applied to the output
* filename. The pattern is "<profileName>_<profilePrefix>.asset"
* \param p The profile that should be processed
* \param profileSectionName The name of the profile subsection used for output filename
* \param func a std::function that takes a reference to a const Profile as arg, and
* returns the asset-ified contents as a std::string object
*/
void convertSectionToAssetFile(const std::string profilePrefix, const Profile& p,
const std::string profileSectionName,
std::function<std::string(const Profile&)> func);
/**
* convertToAsset_* functions extract a section (* as section name) and returns its
* asset-ified version as a string. This allows the profile section to be processed
* by the asset loader. Having individual sections allows for controlling the order of
* processing/loading the profile. It also makes it possible for changing the way
* sections are processed.
*/
/**
* Function to process the meta information included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's meta section, ready
* to be loaded as an asset
*/
std::string convertToAsset_meta(const Profile& p);
/**
* Function to process the assets that are included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's asset section, ready
* to be loaded as an asset
*/
std::string convertToAsset_addedAssets(const Profile& p);
/**
* Function to process the modules that may be included in the profile, and the commands
* to execute if they are/aren't loaded
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's modules section, ready
* to be loaded as an asset
*/
std::string convertToAsset_modules(const Profile& p);
/**
* Function to process the actions that are included in the profile.
* This is separate from, but closely-related to, the keybindings section
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's actions section,
* ready to be loaded as an asset
*/
std::string convertToAsset_actions(const Profile& p);
/**
* Function to process the keybindings that are included in the profile.
* This is separate from, but closely-related to, the actions section
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's keybindings
* section, ready to be loaded as an asset
*/
std::string convertToAsset_keybinds(const Profile& p);
/**
* Function to process the time setting that is included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's time section, ready
* to be loaded as an asset
*/
std::string convertToAsset_time(const Profile& p);
/**
* Function to process the delta time settings that are included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's delta times section, ready
* to be loaded as an asset
*/
std::string convertToAsset_deltaTimes(const Profile& p);
/**
* Function to process the mark-interesting-nodes that are included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's mark-interesting-nodes
* section, ready to be loaded as an asset
*/
std::string convertToAsset_markNodes(const Profile& p);
/**
* Function to process the properties that are included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's properties section, ready
* to be loaded as an asset
*/
std::string convertToAsset_properties(const Profile& p);
/**
* Function to process the initial camera orientation that is included in the profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's camera section, ready
* to be loaded as an asset
*/
std::string convertToAsset_camera(const Profile& p);
/**
* Function to process the additional scripts command section that is included in the
* profile
*
* \param p The profile that should be processed
*
* \return The string representation of the provided profile's additional scripts
* section, ready to be loaded as an asset
*/
std::string convertToAsset_addedScripts(const Profile& p);
/**
* Function to retrieve the individual additional script lines included in the profile
*

View File

@@ -235,15 +235,6 @@ public:
*/
static scripting::LuaLibrary luaLibrary();
/**
* Creates an initial asset file to load, which contains:
* 1. Meta information
* 2. Assets to include
*
* \param p The Profile to be read.
*/
void createInitialAssetToLoad(const Profile& p, const std::string& assetFilename);
/**
* Sets a property using the 'properties' contents of a profile. The function will
* loop through each setProperty command. A property may be set to a bool, float,
@@ -264,15 +255,6 @@ public:
void property_pushValueFromProfileToLuaState(ghoul::lua::LuaState& L,
const std::string& value);
/**
* Reads list of nodes from profile to be marked as interesting nodes.
* If any nodes are listed, a script to mark these will be queued with the
* script engine.
*
* \param p The Profile to be read.
*/
void setFromProfile_markInterestingNodes(const Profile& p);
private:
/**
* Update dependencies.