Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ToDecimal()

decimal System.Xml.ValueHandle.ToDecimal ( )
inline

Definition at line 315 of file ValueHandle.cs.

316 {
317 ValueHandleType type = _type;
318 switch (type)
319 {
320 case ValueHandleType.Decimal:
321 return GetDecimal();
322 case ValueHandleType.Zero:
323 return 0m;
324 case ValueHandleType.One:
325 return 1m;
326 case ValueHandleType.Int8:
327 case ValueHandleType.Int16:
328 case ValueHandleType.Int32:
329 case ValueHandleType.Int64:
330 return ToLong();
331 default:
332 return type switch
333 {
335 ValueHandleType.UTF8 => XmlConverter.ToDecimal(_bufferReader.Buffer, _offset, _length),
336 _ => XmlConverter.ToDecimal(GetString()),
337 };
338 }
339 }
ValueHandleType _type
readonly XmlBufferReader _bufferReader
Definition ValueHandle.cs:9

References System.Xml.ValueHandle._bufferReader, System.Xml.ValueHandle._length, System.Xml.ValueHandle._offset, System.Xml.ValueHandle._type, System.Xml.XmlBufferReader.Buffer, System.Xml.Dictionary, System.Xml.ValueHandle.GetDecimal(), System.Xml.ValueHandle.GetString(), System.Xml.ValueHandle.GetUInt64(), System.Xml.XmlConverter.ToDecimal(), System.Xml.ValueHandle.ToLong(), and System.type.

Referenced by System.Xml.XmlBaseReader.ReadContentAsDecimal(), and System.Xml.ValueHandle.ToObject().