示例#1
0
    public cLineValue(string Key, string sLine)
    {
        sKey      = Key;
        sRawValue = ((sLine.Length > 0) ? sLine : "");

        if (sLine.IndexOf(',') > -1)                                            // Supposing is a MultiVal string
        {
            iType = ( byte )LineValueType.MULTI;
            List <cValue> vValues = Utils.String_RecognizeValues(sLine);
            if (vValues.Count < 1)
            {
                return;
            }
            pMultiValue = new cMultiValue(vValues);
        }
        else             // Single value
        {
            iType = ( byte )LineValueType.SINGLE;
            cValue pValue = Utils.String_RecognizeValue(sLine);
            if (pValue == null)
            {
                Debug.LogError(" cLineValue::Constructor: for key " + Key + " value type is undefined");
                return;
            }
            this.pValue = pValue;
        }

        bIsOK = true;
    }
示例#2
0
    public int                                             GetMultiSize(string Key)
    {
        cLineValue pLineValue = null; cMultiValue pMultiValue = null;

        return((
                   ((pLineValue = GetLineValue(Key)) != null) &&
                   ((pMultiValue = pLineValue.GetMultiValue()) != null)) ?
               (pMultiValue.Size() + 1) : 0);
    }
示例#3
0
    public cValue                                  GetMultiValue(string Key, int Index, int Type)
    {
        cLineValue pLineValue = null; cMultiValue pMultiValue = null; cValue pValue = null;

        if ((pLineValue = GetLineValue(Key)) != null)
        {
            if ((pMultiValue = pLineValue.GetMultiValue()) != null)
            {
                if ((pValue = pMultiValue.At(Index - 1)) != null)
                {
                    return(pValue);
                }
            }
        }

        return(null);
    }
示例#4
0
    public bool                                    bGetMultiValue(string Key, out cValue Out, int Index, int Type)
    {
        cLineValue pLineValue = null; cMultiValue pMultiValue = null; cValue pValue = null;

        if ((pLineValue = GetLineValue(Key)) != null)
        {
            if ((pMultiValue = pLineValue.GetMultiValue()) != null)
            {
                if ((pValue = pMultiValue.At(Index - 1)) != null)
                {
                    Out = pValue;
                    return(true);
                }
            }
        }

        Out = null;
        return(false);
    }
示例#5
0
    public bool                                    bGetVec2(string Key, out Vector2 Out, Vector2 Default)
    {
        cLineValue pLineValue = null; cMultiValue pMultiValue = null;
        cValue     pValue1 = null; cValue pValue2 = null;

        if ((pLineValue = GetLineValue(Key)) != null)
        {
            if ((pMultiValue = pLineValue.GetMultiValue()) != null)
            {
                if (((pValue1 = pMultiValue.At(0)) != null) &&
                    (pValue2 = pMultiValue.At(1)) != null)
                {
                    Out = new Vector2(pValue1.ToFloat(), pValue2.ToFloat());
                    return(true);
                }
            }
        }

        Out = Default;
        return(false);
    }
示例#6
0
 public cLineValue Set(cMultiValue _MultiValue)
 {
     pMultiValue = _MultiValue; return(this);
 }
示例#7
0
 public void Clear()
 {
     pValue = null; pMultiValue = null;
 }
示例#8
0
 public void Destroy()
 {
     pValue = null; pMultiValue = null;
 }