celParameterTools Class Reference
Parameter tools. More...
#include <celtool/stdparams.h>
Static Public Member Functions | |
| static bool | Convert (const celData &in, celDataType type, celData &out) |
| Convert one celData to another type (if possible). | |
| static void | Dump (const char *title, iCelParameterBlock *params, iCelPlLayer *pl=0) |
| Debugging utility to dump a parameter block. | |
| static bool | FillParameterBlock (iCelPlLayer *pl, iCelParameterBlock *params, celVariableParameterBlock *act_params, const csArray< celParSpec > ¶meters, const csRefArray< iParameter > &dyn_parameters) |
| Fill in the dynamic parameters in a parameter block. | |
| static csString | GetDebugData (const celData *data) |
| Get a string representation of 'data' useful for debugging. | |
| static csPtr < celVariableParameterBlock > | GetParameterBlock (iParameterManager *pm, iCelParameterBlock *params, const csArray< celParSpec > ¶meters, csRefArray< iParameter > &dyn_parameters) |
| This is a convenience function to get a parameter block which knows how to recognize parameter usage (starting with '$' or '@') and will in that case try to resolve the parameter by finding it in 'params'. | |
| static celDataType | GetType (const char *name) |
| Return a type given the name. | |
| static csString | GetTypeName (celDataType type) |
| Return the name of a type. | |
| static csRef< iCelParameterBlock > | ParseParams (iObjectRegistry *object_reg, iDocumentNode *node,...) |
| Parse the parameters in a 'params' node. | |
| static bool | ParseParSpecBlock (iObjectRegistry *object_reg, iDocumentNode *node, csArray< celParSpec > ¶meters) |
| Parse an XML node and fill a parameter specification array. | |
| static bool | ToBool (const celData &in, bool &out) |
| Get the value of this data type as a bool. | |
| static bool | ToColor (const celData &in, csColor &out) |
| Get the value of this data type as a color. | |
| static bool | ToColor4 (const celData &in, csColor4 &out) |
| Get the value of this data type as a color4. | |
| static bool | ToFloat (const celData &in, float &out) |
| Get the value of this data type as a float. | |
| static bool | ToLong (const celData &in, long &out) |
| Get the value of this data type as a long. | |
| static bool | ToString (const celData &in, csString &out) |
| Get the value of this data type as a string. | |
| static bool | ToVector2 (const celData &in, csVector2 &out) |
| Get the value of this data type as a vector2. | |
| static bool | ToVector3 (const celData &in, csVector3 &out) |
| Get the value of this data type as a vector3. | |
| static bool | ToVector4 (const celData &in, csVector4 &out) |
| Get the value of this data type as a vector4. | |
| static bool | WriteParams (iObjectRegistry *object_reg, iDocumentNode *node, iCelParameterBlock *params) |
| Write out a parameters block in a document node. | |
| static bool | WriteParSpecBlock (iObjectRegistry *object_reg, iDocumentNode *node, const csArray< celParSpec > ¶meters) |
| Write a parameter specification array to XML. | |
Detailed Description
Parameter tools.
Definition at line 62 of file stdparams.h.
Member Function Documentation
| static bool celParameterTools::Convert | ( | const celData & | in, | |
| celDataType | type, | |||
| celData & | out | |||
| ) | [static] |
Convert one celData to another type (if possible).
Returns false if the conversion is not possible. Only the following types are supported as destination type:
- CEL_DATA_BOOL
- CEL_DATA_LONG
- CEL_DATA_FLOAT
- CEL_DATA_VECTOR2
- CEL_DATA_VECTOR3
- CEL_DATA_VECTOR4
- CEL_DATA_COLOR
- CEL_DATA_COLOR4
- CEL_DATA_STRING
| static void celParameterTools::Dump | ( | const char * | title, | |
| iCelParameterBlock * | params, | |||
| iCelPlLayer * | pl = 0 | |||
| ) | [static] |
Debugging utility to dump a parameter block.
The 'pl' is optional but will be used to get the parameter names if given.
| static bool celParameterTools::FillParameterBlock | ( | iCelPlLayer * | pl, | |
| iCelParameterBlock * | params, | |||
| celVariableParameterBlock * | act_params, | |||
| const csArray< celParSpec > & | parameters, | |||
| const csRefArray< iParameter > & | dyn_parameters | |||
| ) | [static] |
Fill in the dynamic parameters in a parameter block.
Return whether or not the filling has been made.
- Parameters:
-
params is the parameter block given to the reward. msg_params is the resolved parameter block as returned by GetParameterBlock(). parameters is the parameter specifications and unparsed values. dyn_parameters is an array with the dynamic parameters.
Get a string representation of 'data' useful for debugging.
| static csPtr<celVariableParameterBlock> celParameterTools::GetParameterBlock | ( | iParameterManager * | pm, | |
| iCelParameterBlock * | params, | |||
| const csArray< celParSpec > & | parameters, | |||
| csRefArray< iParameter > & | dyn_parameters | |||
| ) | [static] |
This is a convenience function to get a parameter block which knows how to recognize parameter usage (starting with '$' or '@') and will in that case try to resolve the parameter by finding it in 'params'.
- Parameters:
-
params is an input block of parameters. paramspec is the parameter specifications and unparsed values. dyn_parameters will be filled with the parameters.
| static celDataType celParameterTools::GetType | ( | const char * | name | ) | [static] |
Return a type given the name.
| static csString celParameterTools::GetTypeName | ( | celDataType | type | ) | [static] |
Return the name of a type.
| static csRef<iCelParameterBlock> celParameterTools::ParseParams | ( | iObjectRegistry * | object_reg, | |
| iDocumentNode * | node, | |||
| ... | ||||
| ) | [static] |
Parse the parameters in a 'params' node.
and return an implementation of iCelParameterBlock. After the node comes a list of parameter pairs (a string and a celData pointer) with the last parameter name being equal to CEL_PARAM_END. These parameter pairs are also added to the given parameter block by default.
| static bool celParameterTools::ParseParSpecBlock | ( | iObjectRegistry * | object_reg, | |
| iDocumentNode * | node, | |||
| csArray< celParSpec > & | parameters | |||
| ) | [static] |
Parse an XML node and fill a parameter specification array.
The parameters array will be cleared first. Returns false on failure (error already reported).
| static bool celParameterTools::ToBool | ( | const celData & | in, | |
| bool & | out | |||
| ) | [static] |
Get the value of this data type as a bool.
Returns false if there is no sensible way to convert to bool.
Get the value of this data type as a color.
Returns false if there is no sensible way to convert to color.
Get the value of this data type as a color4.
Returns false if there is no sensible way to convert to color4.
| static bool celParameterTools::ToFloat | ( | const celData & | in, | |
| float & | out | |||
| ) | [static] |
Get the value of this data type as a float.
Returns false if there is no sensible way to convert to float.
| static bool celParameterTools::ToLong | ( | const celData & | in, | |
| long & | out | |||
| ) | [static] |
Get the value of this data type as a long.
Returns false if there is no sensible way to convert to long.
Get the value of this data type as a string.
Returns false if there is no sensible way to convert to string.
Get the value of this data type as a vector2.
Returns false if there is no sensible way to convert to vector2.
Get the value of this data type as a vector3.
Returns false if there is no sensible way to convert to vector3.
Get the value of this data type as a vector4.
Returns false if there is no sensible way to convert to vector4.
| static bool celParameterTools::WriteParams | ( | iObjectRegistry * | object_reg, | |
| iDocumentNode * | node, | |||
| iCelParameterBlock * | params | |||
| ) | [static] |
Write out a parameters block in a document node.
Returns false on failure (with error being reported).
| static bool celParameterTools::WriteParSpecBlock | ( | iObjectRegistry * | object_reg, | |
| iDocumentNode * | node, | |||
| const csArray< celParSpec > & | parameters | |||
| ) | [static] |
Write a parameter specification array to XML.
The documentation for this class was generated from the following file:
- celtool/stdparams.h
Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1
