File size: 1,075 Bytes
24b81cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
const int CFG_TYPE_STRING = 0;
const int CFG_TYPE_INT = 1;
const int CFG_TYPE_FLOAT = 2;
const int CFG_TYPE_BOOL = 3;
const int CFG_TYPE_ARRAY = 4;
const int CFG_TYPE_PARAM = 5;
class CfgParam: Managed
{
protected string m_ParamName;
protected string m_ParamValueString;
void CfgParam(string param_name)
{
m_ParamName = param_name;
}
void SetName(string param_name)
{
m_ParamName = param_name;
}
string GetName()
{
return m_ParamName;
}
int GetType()
{
return -1;
}
bool IsArray()
{
return false;
}
static CfgParam CreateParam(string name, int cfg_type)
{
CfgParam param;
switch (cfg_type)
{
case CFG_TYPE_STRING:
{
param = new CfgParamString(name);
break;
}
case CFG_TYPE_INT:
{
param = new CfgParamInt(name);
break;
}
case CFG_TYPE_FLOAT:
{
param = new CfgParamFloat(name);
break;
}
case CFG_TYPE_BOOL:
{
param = new CfgParamBool(name);
break;
}
case CFG_TYPE_ARRAY:
{
param = new CfgParamArray(name);
break;
}
}
return param;
}
} |