public int GetMultiSize(string Key) { cLineValue pLineValue = null; cMultiValue pMultiValue = null; return(( ((pLineValue = GetLineValue(Key)) != null) && ((pMultiValue = pLineValue.GetMultiValue()) != null)) ? (pMultiValue.Size() + 1) : 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); }
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); }
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); }
// 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); }