mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] TEngineServer
[+] TEngineServer
This commit is contained in:
36
Assets/GameScripts/ThirdParty/Protobuf-net/ProtoEnumAttribute.cs
vendored
Normal file
36
Assets/GameScripts/ThirdParty/Protobuf-net/ProtoEnumAttribute.cs
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
namespace ProtoBuf
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to define protocol-buffer specific behavior for
|
||||
/// enumerated values.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
|
||||
public sealed class ProtoEnumAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the specific value to use for this enum during serialization.
|
||||
/// </summary>
|
||||
public int Value
|
||||
{
|
||||
get { return enumValue; }
|
||||
set { this.enumValue = value; hasValue = true; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance has a customised value mapping
|
||||
/// </summary>
|
||||
/// <returns>true if a specific value is set</returns>
|
||||
public bool HasValue() => hasValue;
|
||||
|
||||
private bool hasValue;
|
||||
private int enumValue;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the defined name of the enum, as used in .proto
|
||||
/// (this name is not used during serialization).
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user