Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
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);
    }
Ejemplo n.º 3
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);
    }
Ejemplo n.º 4
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);
    }
Ejemplo n.º 5
0
    // Return the type of a value assigned to a key, or -1
    public int                                             KeyType(string Key)
    {
        if (vSection.Count < 1)
        {
            return(-1);
        }

        cLineValue pLineValue = null; cValue Value = null;

        if ((pLineValue = GetLineValue(Key)) != null)
        {
            int iType = pLineValue.Type();
            switch (iType)
            {
            case ( byte )LineValueType.SINGLE: {
                if ((Value = pLineValue.GetValue()) != null)
                {
                    return(Value.Type());
                }
                Debug.LogError("cSection::KeyType:WARNING! In section " + sName + " a key has no value but designed as SINGLE !!!");
                break;
            }

            case ( byte )LineValueType.MULTI: {
                if ((pLineValue.GetMultiValue() != null))
                {
                    return(iType);
                }
                Debug.LogError("cSection::KeyType:WARNING! In section " + sName + " a key has no value but designed as MULTI !!!");
                break;
            }
            }
        }

        return(-1);
    }