Replace ITraitInfo interface with TraitInfo class.
This commit is contained in:
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
[Desc("Add this to the World actor definition.")]
|
||||
public class FixedColorPaletteInfo : ITraitInfo
|
||||
public class FixedColorPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteReference]
|
||||
[Desc("The name of the palette to base off.")]
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new FixedColorPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new FixedColorPalette(this); }
|
||||
}
|
||||
|
||||
public class FixedColorPalette : ILoadsPalettes
|
||||
|
||||
@@ -23,12 +23,12 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
[Desc("Required for FrozenUnderFog to work. Attach this to the player actor.")]
|
||||
public class FrozenActorLayerInfo : Requires<ShroudInfo>, ITraitInfo
|
||||
public class FrozenActorLayerInfo : TraitInfo, Requires<ShroudInfo>
|
||||
{
|
||||
[Desc("Size of partition bins (cells)")]
|
||||
public readonly int BinSize = 10;
|
||||
|
||||
public object Create(ActorInitializer init) { return new FrozenActorLayer(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new FrozenActorLayer(init.Self, this); }
|
||||
}
|
||||
|
||||
public class FrozenActor
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Primitives;
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
[Desc("Define a player palette by swapping palette indices.")]
|
||||
public class IndexedPlayerPaletteInfo : ITraitInfo, IRulesetLoaded
|
||||
public class IndexedPlayerPaletteInfo : TraitInfo, IRulesetLoaded
|
||||
{
|
||||
[PaletteReference]
|
||||
[Desc("The name of the palette to base off.")]
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public readonly Dictionary<string, int[]> PlayerIndex;
|
||||
|
||||
public object Create(ActorInitializer init) { return new IndexedPlayerPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new IndexedPlayerPalette(this); }
|
||||
|
||||
public void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
[Desc("Add this to the Player actor definition.")]
|
||||
public class PlayerColorPaletteInfo : ITraitInfo
|
||||
public class PlayerColorPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteReference]
|
||||
[Desc("The name of the palette to base off.")]
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerColorPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new PlayerColorPalette(this); }
|
||||
}
|
||||
|
||||
public class PlayerColorPalette : ILoadsPlayerPalettes
|
||||
|
||||
@@ -16,7 +16,7 @@ using OpenRA.Primitives;
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
[Desc("Add this to the Player actor definition.")]
|
||||
public class PlayerHighlightPaletteInfo : ITraitInfo
|
||||
public class PlayerHighlightPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteDefinition(true)]
|
||||
[Desc("The prefix for the resulting player palettes")]
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Index set to be fully transparent/invisible.")]
|
||||
public readonly int TransparentIndex = 0;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerHighlightPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new PlayerHighlightPalette(this); }
|
||||
}
|
||||
|
||||
public class PlayerHighlightPalette : ILoadsPlayerPalettes
|
||||
|
||||
@@ -15,7 +15,7 @@ using System.Collections.Generic;
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
[Desc("Required for shroud and fog visibility checks. Add this to the player actor.")]
|
||||
public class ShroudInfo : ITraitInfo, ILobbyOptions
|
||||
public class ShroudInfo : TraitInfo, ILobbyOptions
|
||||
{
|
||||
[Translate]
|
||||
[Desc("Descriptive label for the fog checkbox in the lobby.")]
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Traits
|
||||
FogCheckboxVisible, FogCheckboxDisplayOrder, FogCheckboxEnabled, FogCheckboxLocked);
|
||||
}
|
||||
|
||||
public object Create(ActorInitializer init) { return new Shroud(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new Shroud(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Shroud : ISync, INotifyCreated, ITick
|
||||
|
||||
Reference in New Issue
Block a user