Add SequenceReference support for dictionaries.

This commit is contained in:
Paul Chote
2020-08-12 23:22:38 +01:00
committed by abcdefg30
parent 7803686aec
commit 94180f6a0a
6 changed files with 80 additions and 13 deletions

View File

@@ -13,6 +13,13 @@ using System;
namespace OpenRA.Traits
{
public enum LintDictionaryReference
{
None = 0,
Keys = 1,
Values = 2
}
[AttributeUsage(AttributeTargets.Field)]
public sealed class ActorReferenceAttribute : Attribute
{
@@ -29,15 +36,19 @@ namespace OpenRA.Traits
[AttributeUsage(AttributeTargets.Field)]
public sealed class SequenceReferenceAttribute : Attribute
{
public readonly string ImageReference; // The field name in the same trait info that contains the image name.
// The field name in the same trait info that contains the image name.
public readonly string ImageReference;
public readonly bool Prefix;
public readonly bool AllowNullImage;
public readonly LintDictionaryReference DictionaryReference;
public SequenceReferenceAttribute(string imageReference = null, bool prefix = false, bool allowNullImage = false)
public SequenceReferenceAttribute(string imageReference = null, bool prefix = false, bool allowNullImage = false,
LintDictionaryReference dictionaryReference = LintDictionaryReference.None)
{
ImageReference = imageReference;
Prefix = prefix;
AllowNullImage = allowNullImage;
DictionaryReference = dictionaryReference;
}
}