IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Abstract base class for storing generic static data of module functions loaded from a config file. More...
Public Member Functions | |
virtual bool | LoadFromFile (string configfile, IMSFILE cfg) |
Loads the data from config file. More... | |
virtual bool | HasGui () |
This function serves to check whether a module function has a GUI before creating it. More... | |
FUNCTIONTYPE | GetType () |
string | GetName () |
Protected Member Functions | |
virtual bool | processConfigLine (vector< string > &tokens)=0 |
Receives all lines of the config file that concern this ModuleFunction one by one. More... | |
virtual bool | validateData (string configfile)=0 |
Validates the data for completeness after loading. More... | |
Protected Attributes | |
FUNCTIONTYPE | type |
Stores the type of the ModuleFunction. | |
string | name = "" |
Stores the Name of the ModuleFunction. | |
Abstract base class for storing generic static data of module functions loaded from a config file.
Every derivative of IMS_ModuleFunction_Base() needs a corresponding derivative of this class to load and store its configfile data.
Module functions are specific abilities that can be added to a module in a config file, like thrusters, tanks, habitat etc. Many modules will have only one module function, but an arbitrary number of modulefunctions can be defined for any module.
An arbitrary number of module functions can be defined for any module. Any module function must be enclosed in a module function block like this:
For a list of valid modulefunction ids, see the documentation for IMS_ModuleFunctionFactory.h
These parameters can be added to any module function
|
inline |
|
inline |
|
inlinevirtual |
This function serves to check whether a module function has a GUI before creating it.
Reimplemented in IMS_ModuleFunctionData_Thruster, IMS_ModuleFunctionData_Rcs, IMS_ModuleFunctionData_Gear, IMS_ModuleFunctionData_Tank, and IMS_ModuleFunctionData_Comm.
|
inlinevirtual |
Loads the data from config file.
configfile | The name of the config file |
cfg | The config file itself, wrapped in an IMSFILE structure for oapi independency |
Reimplemented in IMS_ModuleFunctionData_Animation.
|
protectedpure virtual |
Receives all lines of the config file that concern this ModuleFunction one by one.
Overload this function to receive the relevant data of your module.
tokens | a vector of strings that contains the individual parts of the line, delimited by whitespace or '=' |
Implemented in IMS_ModuleFunctionData_Animation, IMS_ModuleFunctionData_Thruster, IMS_ModuleFunctionData_Rcs, IMS_ModuleFunctionData_Gear, IMS_ModuleFunctionData_Tank, IMS_ModuleFunctionData_Comm, and IMS_ModuleFunctionData_Pressurised.
|
protectedpure virtual |
Validates the data for completeness after loading.
Implement this function to validate your data at the end of the loading process. Check if everything's there that needs to be, and write log messages if it isn't.
configfile | The name of the configfile, so you can add it to your messages so config writers find their mistakes faster. |
Implemented in IMS_ModuleFunctionData_Animation, IMS_ModuleFunctionData_Thruster, IMS_ModuleFunctionData_Rcs, IMS_ModuleFunctionData_Gear, IMS_ModuleFunctionData_Tank, IMS_ModuleFunctionData_Comm, and IMS_ModuleFunctionData_Pressurised.