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

◆ ToObject()

object System.Variant.ToObject ( )
inline

Definition at line 308 of file Variant.cs.

309 {
310 return CVType switch
311 {
312 0 => null,
313 2 => (int)_data != 0,
314 4 => (sbyte)_data,
315 5 => (byte)_data,
316 3 => (char)_data,
317 6 => (short)_data,
318 7 => (ushort)_data,
319 8 => (int)_data,
320 9 => (uint)_data,
321 10 => _data,
322 11 => (ulong)_data,
323 12 => BitConverter.UInt32BitsToSingle((uint)_data),
324 13 => BitConverter.Int64BitsToDouble(_data),
325 16 => new DateTime(_data),
326 17 => new TimeSpan(_data),
327 21 => BoxEnum(),
328 22 => Type.Missing,
329 23 => System.DBNull.Value,
330 _ => _objref,
331 };
332 }
static readonly DBNull Value
Definition DBNull.cs:8
object BoxEnum()
object _objref
Definition Variant.cs:10

References System.Variant._data, System.Variant._objref, System.Variant.BoxEnum(), System.Variant.CVType, System.DateTime, System.BitConverter.Int64BitsToDouble(), System.Type.Missing, System.BitConverter.UInt32BitsToSingle(), and System.DBNull.Value.