//
// Parameters.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.
namespace NosSmooth.PacketSerializersGenerator.Data;
///
/// Contains set of parameters of a packet.
///
public class Parameters
{
///
/// Initializes a new instance of the class.
///
/// The list of the parameters.
public Parameters(IReadOnlyList parameters)
{
List = parameters;
}
///
/// Gets the list of the parameters.
///
public IReadOnlyList List { get; }
///
/// Gets the current index of the parameter.
///
public int CurrentIndex { get; set; }
///
/// Gets the currently processing parameter.
///
public ParameterInfo Current => List[CurrentIndex];
///
/// Gets the next processing parameter.
///
public ParameterInfo Next => List[CurrentIndex];
///
/// Gets the previous processing parameter.
///
public ParameterInfo Previous => List[CurrentIndex];
///
/// Gets whether the current parameter is the last one.
///
public bool IsLast => CurrentIndex == List.Count - 1;
///
/// Gets whether the current parameter is the first one.
///
public bool IsFirst => CurrentIndex == 0;
}