You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
5.1 KiB

// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Sessions
{
public struct AttributeDataValue
{
private long? m_AsInt64;
private double? m_AsDouble;
private bool? m_AsBool;
private Utf8String m_AsUtf8;
private AttributeType m_ValueType;
/// <summary>
/// Stored as an 8 byte integer
/// </summary>
public long? AsInt64
{
get
{
long? value;
Helper.Get(m_AsInt64, out value, m_ValueType, AttributeType.Int64);
return value;
}
set
{
Helper.Set<long?, AttributeType>(value, ref m_AsInt64, AttributeType.Int64, ref m_ValueType);
}
}
/// <summary>
/// Stored as a <see cref="double" /> precision floating point
/// </summary>
public double? AsDouble
{
get
{
double? value;
Helper.Get(m_AsDouble, out value, m_ValueType, AttributeType.Double);
return value;
}
set
{
Helper.Set<double?, AttributeType>(value, ref m_AsDouble, AttributeType.Double, ref m_ValueType);
}
}
/// <summary>
/// Stored as a boolean
/// </summary>
public bool? AsBool
{
get
{
bool? value;
Helper.Get(m_AsBool, out value, m_ValueType, AttributeType.Boolean);
return value;
}
set
{
Helper.Set<bool?, AttributeType>(value, ref m_AsBool, AttributeType.Boolean, ref m_ValueType);
}
}
/// <summary>
/// Stored as a null terminated UTF8 string
/// </summary>
public Utf8String AsUtf8
{
get
{
Utf8String value;
Helper.Get(m_AsUtf8, out value, m_ValueType, AttributeType.String);
return value;
}
set
{
Helper.Set<Utf8String, AttributeType>(value, ref m_AsUtf8, AttributeType.String, ref m_ValueType);
}
}
/// <summary>
/// Type of value stored in the union
/// </summary>
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<AttributeDataValue>, ISettable<AttributeDataValue>, 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<long, AttributeType>(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<double, AttributeType>(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<AttributeType>(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);
}
}
}