-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNameOverrideAttribute.cs
More file actions
34 lines (31 loc) · 1019 Bytes
/
NameOverrideAttribute.cs
File metadata and controls
34 lines (31 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2023 Vladimir Popov zor1994@gmail.com https://github.com/ZorPastaman/UtilityAI
using System;
using JetBrains.Annotations;
namespace Zor.UtilityAI.DrawingAttributes
{
/// <summary>
/// Overrides a default field name in a
/// <see cref="Zor.UtilityAI.Serialization.SerializedActions"/> and
/// <see cref="Zor.UtilityAI.Serialization.SerializedConsiderations"/>.
/// The field must have a <see cref="NameOverridenAttribute"/> with the same index.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class NameOverrideAttribute : Attribute
{
/// <summary>
/// New field name.
/// </summary>
[NotNull] public readonly string name;
/// <summary>
/// Target field index.
/// </summary>
public readonly int index;
/// <param name="name">New field name.</param>
/// <param name="index">Target field index.</param>
public NameOverrideAttribute([NotNull] string name, int index)
{
this.name = name;
this.index = index;
}
}
}