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; }
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); }
public cLineValue Set(cMultiValue _MultiValue) { pMultiValue = _MultiValue; return(this); }
public void Clear() { pValue = null; pMultiValue = null; }
public void Destroy() { pValue = null; pMultiValue = null; }