// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.Lobby { public struct AttributeDataValue { private long? m_AsInt64; private double? m_AsDouble; private bool? m_AsBool; private Utf8String m_AsUtf8; private AttributeType m_ValueType; /// /// Stored as an 8 byte integer /// public long? AsInt64 { get { long? value; Helper.Get(m_AsInt64, out value, m_ValueType, AttributeType.Int64); return value; } set { Helper.Set(value, ref m_AsInt64, AttributeType.Int64, ref m_ValueType); } } /// /// Stored as a precision floating point /// public double? AsDouble { get { double? value; Helper.Get(m_AsDouble, out value, m_ValueType, AttributeType.Double); return value; } set { Helper.Set(value, ref m_AsDouble, AttributeType.Double, ref m_ValueType); } } /// /// Stored as a boolean /// public bool? AsBool { get { bool? value; Helper.Get(m_AsBool, out value, m_ValueType, AttributeType.Boolean); return value; } set { Helper.Set(value, ref m_AsBool, AttributeType.Boolean, ref m_ValueType); } } /// /// Stored as a null terminated UTF8 string /// public Utf8String AsUtf8 { get { Utf8String value; Helper.Get(m_AsUtf8, out value, m_ValueType, AttributeType.String); return value; } set { Helper.Set(value, ref m_AsUtf8, AttributeType.String, ref m_ValueType); } } /// /// Type of value stored in the union /// public AttributeType ValueType { get { return m_ValueType; } private set { m_ValueType = value; } } public static implicit operator AttributeDataValue(long value) { return new AttributeDataValue() { AsInt64 = value }; } public static implicit operator AttributeDataValue(double value) { return new AttributeDataValue() { AsDouble = value }; } public static implicit operator AttributeDataValue(bool value) { return new AttributeDataValue() { AsBool = value }; } public static implicit operator AttributeDataValue(Utf8String value) { return new AttributeDataValue() { AsUtf8 = value }; } public static implicit operator AttributeDataValue(string value) { return new AttributeDataValue() { AsUtf8 = value }; } internal void Set(ref AttributeDataValueInternal other) { AsInt64 = other.AsInt64; AsDouble = other.AsDouble; AsBool = other.AsBool; AsUtf8 = other.AsUtf8; } } [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit, Pack = 8)] internal struct AttributeDataValueInternal : IGettable, ISettable, System.IDisposable { [System.Runtime.InteropServices.FieldOffset(0)] private long m_AsInt64; [System.Runtime.InteropServices.FieldOffset(0)] private double m_AsDouble; [System.Runtime.InteropServices.FieldOffset(0)] private int m_AsBool; [System.Runtime.InteropServices.FieldOffset(0)] private System.IntPtr m_AsUtf8; [System.Runtime.InteropServices.FieldOffset(8)] private AttributeType m_ValueType; public long? AsInt64 { get { long? value; Helper.Get(m_AsInt64, out value, m_ValueType, AttributeType.Int64); return value; } set { Helper.Set(value, ref m_AsInt64, AttributeType.Int64, ref m_ValueType, this); } } public double? AsDouble { get { double? value; Helper.Get(m_AsDouble, out value, m_ValueType, AttributeType.Double); return value; } set { Helper.Set(value, ref m_AsDouble, AttributeType.Double, ref m_ValueType, this); } } public bool? AsBool { get { bool? value; Helper.Get(m_AsBool, out value, m_ValueType, AttributeType.Boolean); return value; } set { Helper.Set(value, ref m_AsBool, AttributeType.Boolean, ref m_ValueType, this); } } public Utf8String AsUtf8 { get { Utf8String value; Helper.Get(m_AsUtf8, out value, m_ValueType, AttributeType.String); return value; } set { Helper.Set(value, ref m_AsUtf8, AttributeType.String, ref m_ValueType, this); } } public void Set(ref AttributeDataValue other) { AsInt64 = other.AsInt64; AsDouble = other.AsDouble; AsBool = other.AsBool; AsUtf8 = other.AsUtf8; } public void Set(ref AttributeDataValue? other) { if (other.HasValue) { AsInt64 = other.Value.AsInt64; AsDouble = other.Value.AsDouble; AsBool = other.Value.AsBool; AsUtf8 = other.Value.AsUtf8; } } public void Dispose() { Helper.Dispose(ref m_AsUtf8, m_ValueType, AttributeType.String); } public void Get(out AttributeDataValue output) { output = new AttributeDataValue(); output.Set(ref this); } } }