//
//  PacketIndexAttribute.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace NosSmooth.Packets.Attributes;
/// 
/// Attribute for marking properties in packets with their position in the packet.
/// 
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter)]
public class PacketIndexAttribute : Attribute
{
    /// 
    /// Initializes a new instance of the  class.
    /// 
    /// The position of the property.
    public PacketIndexAttribute(ushort index)
    {
        Index = index;
    }
    /// 
    /// Gets the index of the current property.
    /// 
    public ushort Index { get; }
    /// 
    /// Gets the inner separator used for complex types such as sub packets.
    /// 
    public char InnerSeparator { get; set; } = (char)0xFF;
    /// 
    /// Gets the separator after this field.
    /// 
    public char AfterSeparator { get; set; } = (char)0xFF;
}