Files
OpenRA/OpenRA.Game/Traits/LintAttributes.cs
Matthias Mailänder defba7aece lint check player palette reference
and tell which actor is affected when a problem is found
2015-09-27 14:57:58 +02:00

73 lines
2.2 KiB
C#

#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
namespace OpenRA.Traits
{
/* attributes used by OpenRA.Lint to understand the rules */
[AttributeUsage(AttributeTargets.Field)]
public sealed class ActorReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class WeaponReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class VoiceSetReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class VoiceReferenceAttribute : Attribute { }
[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.
public readonly bool Prefix;
public SequenceReferenceAttribute(string imageReference = null, bool prefix = false)
{
ImageReference = imageReference;
Prefix = prefix;
}
}
[AttributeUsage(AttributeTargets.Field)]
public sealed class UpgradeGrantedReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class UpgradeUsedReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class PaletteDefinitionAttribute : Attribute
{
public readonly bool IsPlayerPalette;
public PaletteDefinitionAttribute(bool isPlayerPalette = false)
{
IsPlayerPalette = isPlayerPalette;
}
}
[AttributeUsage(AttributeTargets.Field)]
public sealed class PaletteReferenceAttribute : Attribute
{
public readonly bool IsPlayerPalette;
public PaletteReferenceAttribute(bool isPlayerPalette = false)
{
IsPlayerPalette = isPlayerPalette;
}
public readonly string PlayerPaletteReferenceSwitch;
public PaletteReferenceAttribute(string playerPaletteReferenceSwitch)
{
PlayerPaletteReferenceSwitch = playerPaletteReferenceSwitch;
}
}
}