Example #1
0
    public string[] GetStringArray(string key)
    {
        if (this.ContainsKey(key))
        {
            return(ParseTool.String2StringArray(this[key]));
        }

        if (data.m_defaultValue.ContainsKey(key))
        {
            return(ParseTool.String2StringArray(data.m_defaultValue[key]));
        }

        throw new Exception("Don't Exist Value or DefaultValue by ->" + key + "<- TableName is : ->" + data.m_tableName + "<- singleDataName : ->" + m_SingleDataName + "<-");// throw
    }
    public static object TableString2ObjectValue(string v, FieldType fieldValueType, string enumType)
    {
        object t = null;

        switch (fieldValueType)
        {
        case FieldType.String:
            t = v;
            break;

        case FieldType.Bool:
            t = bool.Parse(v);
            break;

        case FieldType.Int:
            t = int.Parse(v);
            break;

        case FieldType.Float:
            t = float.Parse(v);
            break;

        case FieldType.Vector2:
            t = ParseTool.String2Vector2(v);
            break;

        case FieldType.Vector3:
            t = ParseTool.String2Vector3(v);
            break;

        case FieldType.Color:
            t = ParseTool.String2Color(v);
            break;

        case FieldType.Enum:
            Type type = ConfigFieldValueType2Type(fieldValueType, enumType);
            t = Enum.Parse(type, v);
            break;

        case FieldType.StringArray:
            t = ParseTool.String2StringArray(v);
            break;

        case FieldType.IntArray:
            t = ParseTool.String2IntArray(v);
            break;

        case FieldType.FloatArray:
            t = ParseTool.String2FloatArray(v);
            break;

        case FieldType.BoolArray:
            t = ParseTool.String2BoolArray(v);
            break;

        case FieldType.Vector2Array:
            t = ParseTool.String2Vector2(v);
            break;

        case FieldType.Vector3Array:
            t = ParseTool.String2Vector3Array(v);
            break;

        default:
            break;
        }

        return(t);
    }
Example #3
0
 public string[] GetStringArray()
 {
     return(ParseTool.String2StringArray(m_content));
 }