Replace ITraitInfo interface with TraitInfo class.

This commit is contained in:
Paul Chote
2020-05-11 18:12:19 +01:00
committed by reaperrr
parent 3cd7ec3878
commit 86f61298e6
243 changed files with 510 additions and 505 deletions

View File

@@ -18,12 +18,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class ActorMapInfo : ITraitInfo
public class ActorMapInfo : TraitInfo
{
[Desc("Size of partition bins (cells)")]
public readonly int BinSize = 10;
public object Create(ActorInitializer init) { return new ActorMap(init.World, this); }
public override object Create(ActorInitializer init) { return new ActorMap(init.World, this); }
}
public class ActorMap : IActorMap, ITick, INotifyCreated

View File

@@ -25,9 +25,9 @@ namespace OpenRA.Mods.Common.Traits
CPos Location { get; }
}
class BridgeLayerInfo : ITraitInfo
class BridgeLayerInfo : TraitInfo
{
public object Create(ActorInitializer init) { return new BridgeLayer(init.World); }
public override object Create(ActorInitializer init) { return new BridgeLayer(init.World); }
}
class BridgeLayer

View File

@@ -17,11 +17,11 @@ namespace OpenRA.Mods.Common.Traits
{
[Desc("Sets a custom terrain type for cells that are obscured by back-facing cliffs.",
"This trait replicates the default CliffBackImpassability=2 behaviour from the TS/RA2 rules.ini.")]
class CliffBackImpassabilityLayerInfo : ITraitInfo
class CliffBackImpassabilityLayerInfo : TraitInfo
{
public readonly string TerrainType = "Impassable";
public object Create(ActorInitializer init) { return new CliffBackImpassabilityLayer(this); }
public override object Create(ActorInitializer init) { return new CliffBackImpassabilityLayer(this); }
}
class CliffBackImpassabilityLayer : IWorldLoaded

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class CrateSpawnerInfo : ITraitInfo, ILobbyOptions
public class CrateSpawnerInfo : TraitInfo, ILobbyOptions
{
[Translate]
[Desc("Descriptive label for the crates checkbox in the lobby.")]
@@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits
yield return new LobbyBooleanOption("crates", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
}
public object Create(ActorInitializer init) { return new CrateSpawner(init.Self, this); }
public override object Create(ActorInitializer init) { return new CrateSpawner(init.Self, this); }
}
public class CrateSpawner : ITick, INotifyCreated

View File

@@ -20,12 +20,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Required for the map editor to work. Attach this to the world actor.")]
public class EditorActorLayerInfo : ITraitInfo
public class EditorActorLayerInfo : TraitInfo
{
[Desc("Size of partition bins (world pixels)")]
public readonly int BinSize = 250;
public object Create(ActorInitializer init) { return new EditorActorLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new EditorActorLayer(init.Self, this); }
}
public class EditorActorLayer : IWorldLoaded, ITickRender, IRender, IRadarSignature, ICreatePlayers, IRenderAnnotations

View File

@@ -19,11 +19,11 @@ namespace OpenRA.Mods.Common.Traits
public enum EditorCursorType { None, Actor, TerrainTemplate, Resource }
[Desc("Required for the map editor to work. Attach this to the world actor.")]
public class EditorCursorLayerInfo : ITraitInfo, Requires<EditorActorLayerInfo>
public class EditorCursorLayerInfo : TraitInfo, Requires<EditorActorLayerInfo>
{
public readonly int PreviewFacing = 96;
public object Create(ActorInitializer init) { return new EditorCursorLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new EditorCursorLayer(init.Self, this); }
}
public class EditorCursorLayer : ITickRender, IRenderAboveShroud, IRenderAnnotations

View File

@@ -21,9 +21,9 @@ namespace OpenRA.Mods.Common.Traits
using CellContents = ResourceLayer.CellContents;
[Desc("Required for the map editor to work. Attach this to the world actor.")]
public class EditorResourceLayerInfo : ITraitInfo, Requires<ResourceTypeInfo>
public class EditorResourceLayerInfo : TraitInfo, Requires<ResourceTypeInfo>
{
public virtual object Create(ActorInitializer init) { return new EditorResourceLayer(init.Self); }
public override object Create(ActorInitializer init) { return new EditorResourceLayer(init.Self); }
}
public class EditorResourceLayer : IWorldLoaded, IRenderOverlay, INotifyActorDisposing

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Required for the map editor to work. Attach this to the world actor.")]
public class EditorSelectionLayerInfo : ITraitInfo
public class EditorSelectionLayerInfo : TraitInfo
{
[PaletteReference]
[Desc("Palette to use for rendering the placement sprite.")]
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Sequence to use for the paste overlay.")]
public readonly string PasteSequence = "paste";
public virtual object Create(ActorInitializer init) { return new EditorSelectionLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new EditorSelectionLayer(init.Self, this); }
}
public class EditorSelectionLayer : IWorldLoaded, IRenderAboveShroud

View File

@@ -15,12 +15,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class ElevatedBridgeLayerInfo : ITraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
public class ElevatedBridgeLayerInfo : TraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
{
[Desc("Terrain type used by cells outside any elevated bridge footprint.")]
public readonly string ImpassableTerrainType = "Impassable";
public object Create(ActorInitializer init) { return new ElevatedBridgeLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new ElevatedBridgeLayer(init.Self, this); }
}
// For now this is mostly copies TerrainTunnelLayer. This will change once bridge destruction is implemented

View File

@@ -15,12 +15,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class ExitsDebugOverlayManagerInfo : ITraitInfo
public class ExitsDebugOverlayManagerInfo : TraitInfo
{
[Desc("The font used to draw cell vectors. Should match the value as-is in the Fonts section of the mod manifest (do not convert to lowercase).")]
public readonly string Font = "TinyBold";
object ITraitInfo.Create(ActorInitializer init) { return new ExitsDebugOverlayManager(init.Self, this); }
public override object Create(ActorInitializer init) { return new ExitsDebugOverlayManager(init.Self, this); }
}
public class ExitsDebugOverlayManager : IWorldLoaded, IChatCommand

View File

@@ -16,9 +16,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class GameSaveViewportManagerInfo : ITraitInfo
public class GameSaveViewportManagerInfo : TraitInfo
{
public object Create(ActorInitializer init) { return new GameSaveViewportManager(); }
public override object Create(ActorInitializer init) { return new GameSaveViewportManager(); }
}
public class GameSaveViewportManager : IWorldLoaded, IGameSaveTraitData

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class JumpjetActorLayerInfo : ITraitInfo
public class JumpjetActorLayerInfo : TraitInfo
{
[Desc("Terrain type of the airborne layer.")]
public readonly string TerrainType = "Jumpjet";
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Cell radius for smoothing adjacent cell heights.")]
public readonly int SmoothingRadius = 2;
public object Create(ActorInitializer init) { return new JumpjetActorLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new JumpjetActorLayer(init.Self, this); }
}
public class JumpjetActorLayer : ICustomMovementLayer

View File

@@ -17,12 +17,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
class LegacyBridgeLayerInfo : ITraitInfo
class LegacyBridgeLayerInfo : TraitInfo
{
[ActorReference]
public readonly string[] Bridges = { "bridge1", "bridge2" };
public object Create(ActorInitializer init) { return new LegacyBridgeLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new LegacyBridgeLayer(init.Self, this); }
}
class LegacyBridgeLayer : IWorldLoaded

View File

@@ -16,7 +16,7 @@ using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Traits
{
public class LoadWidgetAtGameStartInfo : ITraitInfo
public class LoadWidgetAtGameStartInfo : TraitInfo
{
[Desc("The widget tree to open when a shellmap is loaded (i.e. the main menu).")]
public readonly string ShellmapRoot = "MAINMENU";
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Remove any existing UI when a map is loaded.")]
public readonly bool ClearRoot = true;
public object Create(ActorInitializer init) { return new LoadWidgetAtGameStart(this); }
public override object Create(ActorInitializer init) { return new LoadWidgetAtGameStart(this); }
}
public class LoadWidgetAtGameStart : IWorldLoaded, INotifyGameLoading, INotifyGameLoaded

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Enables defined prerequisites at game start for all players if the checkbox is enabled.")]
public class LobbyPrerequisiteCheckboxInfo : ITraitInfo, ILobbyOptions, ITechTreePrerequisiteInfo
public class LobbyPrerequisiteCheckboxInfo : TraitInfo, ILobbyOptions, ITechTreePrerequisiteInfo
{
[FieldLoader.Require]
[Desc("Internal id for this checkbox.")]
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
Visible, DisplayOrder, Enabled, Locked);
}
public object Create(ActorInitializer init) { return new LobbyPrerequisiteCheckbox(this); }
public override object Create(ActorInitializer init) { return new LobbyPrerequisiteCheckbox(this); }
}
public class LobbyPrerequisiteCheckbox : INotifyCreated, ITechTreePrerequisite

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
}
[Desc("Used by Mobile. Attach these to the world actor. You can have multiple variants by adding @suffixes.")]
public class LocomotorInfo : ITraitInfo
public class LocomotorInfo : TraitInfo
{
[Desc("Locomotor ID.")]
public readonly string Name = "default";
@@ -184,7 +184,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual bool DisableDomainPassabilityCheck { get { return false; } }
public virtual object Create(ActorInitializer init) { return new Locomotor(init.Self, this); }
public override object Create(ActorInitializer init) { return new Locomotor(init.Self, this); }
}
public class Locomotor : IWorldLoaded

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Allows the map to have working spawnpoints. Also controls the 'Separate Team Spawns' checkbox in the lobby options.")]
public class MPStartLocationsInfo : ITraitInfo, ILobbyOptions
public class MPStartLocationsInfo : TraitInfo, ILobbyOptions
{
public readonly WDist InitialExploreRange = WDist.FromCells(5);
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Display order for the spawn positions checkbox in the lobby.")]
public readonly int SeparateTeamSpawnsCheckboxDisplayOrder = 0;
public virtual object Create(ActorInitializer init) { return new MPStartLocations(this); }
public override object Create(ActorInitializer init) { return new MPStartLocations(this); }
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
{

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Controls the build radius checkboxes in the lobby options.")]
public class MapBuildRadiusInfo : ITraitInfo, ILobbyOptions
public class MapBuildRadiusInfo : TraitInfo, ILobbyOptions
{
[Translate]
[Desc("Descriptive label for the ally build radius checkbox in the lobby.")]
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits
BuildRadiusCheckboxVisible, BuildRadiusCheckboxDisplayOrder, BuildRadiusCheckboxEnabled, BuildRadiusCheckboxLocked);
}
public object Create(ActorInitializer init) { return new MapBuildRadius(this); }
public override object Create(ActorInitializer init) { return new MapBuildRadius(this); }
}
public class MapBuildRadius : INotifyCreated

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Controls the 'Creeps' checkbox in the lobby options.")]
public class MapCreepsInfo : ITraitInfo, ILobbyOptions
public class MapCreepsInfo : TraitInfo, ILobbyOptions
{
[Translate]
[Desc("Descriptive label for the creeps checkbox in the lobby.")]
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
yield return new LobbyBooleanOption("creeps", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
}
public object Create(ActorInitializer init) { return new MapCreeps(this); }
public override object Create(ActorInitializer init) { return new MapCreeps(this); }
}
public class MapCreeps : INotifyCreated

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Controls the game speed, tech level, and short game lobby options.")]
public class MapOptionsInfo : ITraitInfo, ILobbyOptions, IRulesetLoaded
public class MapOptionsInfo : TraitInfo, ILobbyOptions, IRulesetLoaded
{
[Translate]
[Desc("Descriptive label for the short game checkbox in the lobby.")]
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
throw new YamlException("Invalid default game speed '{0}'.".F(GameSpeed));
}
public object Create(ActorInitializer init) { return new MapOptions(this); }
public override object Create(ActorInitializer init) { return new MapOptions(this); }
}
public class MapOptions : INotifyCreated

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Trait for music handling. Attach this to the world actor.")]
public class MusicPlaylistInfo : ITraitInfo
public class MusicPlaylistInfo : TraitInfo
{
[Desc("Music to play when the map starts.", "Plays the first song on the playlist when undefined.")]
public readonly string StartingMusic = null;
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Disable all world sounds (combat etc).")]
public readonly bool DisableWorldSounds = false;
public object Create(ActorInitializer init) { return new MusicPlaylist(init.World, this); }
public override object Create(ActorInitializer init) { return new MusicPlaylist(init.World, this); }
}
public class MusicPlaylist : INotifyActorDisposing, IGameOver, IWorldLoaded, INotifyGameLoaded

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class PaletteFromEmbeddedSpritePaletteInfo : ITraitInfo, IProvidesCursorPaletteInfo
public class PaletteFromEmbeddedSpritePaletteInfo : TraitInfo, IProvidesCursorPaletteInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Whether this palette is available for cursors.")]
public readonly bool CursorPalette = false;
public object Create(ActorInitializer init) { return new PaletteFromEmbeddedSpritePalette(this); }
public override object Create(ActorInitializer init) { return new PaletteFromEmbeddedSpritePalette(this); }
string IProvidesCursorPaletteInfo.Palette { get { return CursorPalette ? Name : null; } }

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Load VGA palette (.pal) registers.")]
class PaletteFromFileInfo : ITraitInfo, IProvidesCursorPaletteInfo
class PaletteFromFileInfo : TraitInfo, IProvidesCursorPaletteInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Whether this palette is available for cursors.")]
public readonly bool CursorPalette = false;
public object Create(ActorInitializer init) { return new PaletteFromFile(init.World, this); }
public override object Create(ActorInitializer init) { return new PaletteFromFile(init.World, this); }
string IProvidesCursorPaletteInfo.Palette { get { return CursorPalette ? Name : null; } }

View File

@@ -20,7 +20,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Load a GIMP .gpl or JASC .pal palette file. Supports per-color alpha.")]
class PaletteFromGimpOrJascFileInfo : ITraitInfo, IProvidesCursorPaletteInfo
class PaletteFromGimpOrJascFileInfo : TraitInfo, IProvidesCursorPaletteInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Whether this palette is available for cursors.")]
public readonly bool CursorPalette = false;
public object Create(ActorInitializer init) { return new PaletteFromGimpOrJascFile(init.World, this); }
public override object Create(ActorInitializer init) { return new PaletteFromGimpOrJascFile(init.World, this); }
string IProvidesCursorPaletteInfo.Palette { get { return CursorPalette ? Name : null; } }

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Create a palette by applying alpha transparency to another palette.")]
class PaletteFromPaletteWithAlphaInfo : ITraitInfo
class PaletteFromPaletteWithAlphaInfo : TraitInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Premultiply color by the alpha component.")]
public readonly bool Premultiply = true;
public object Create(ActorInitializer init) { return new PaletteFromPaletteWithAlpha(this); }
public override object Create(ActorInitializer init) { return new PaletteFromPaletteWithAlpha(this); }
}
class PaletteFromPaletteWithAlpha : ILoadsPalettes, IProvidesAssetBrowserPalettes

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Create player palettes by applying alpha transparency to another player palette.")]
class PaletteFromPlayerPaletteWithAlphaInfo : ITraitInfo
class PaletteFromPlayerPaletteWithAlphaInfo : TraitInfo
{
[FieldLoader.Require]
[PaletteDefinition(true)]
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Premultiply color by the alpha component.")]
public readonly bool Premultiply = true;
public object Create(ActorInitializer init) { return new PaletteFromPlayerPaletteWithAlpha(this); }
public override object Create(ActorInitializer init) { return new PaletteFromPlayerPaletteWithAlpha(this); }
}
class PaletteFromPlayerPaletteWithAlpha : ILoadsPlayerPalettes

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Load a PNG and use its embedded palette.")]
class PaletteFromPngInfo : ITraitInfo, IProvidesCursorPaletteInfo
class PaletteFromPngInfo : TraitInfo, IProvidesCursorPaletteInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Whether this palette is available for cursors.")]
public readonly bool CursorPalette = false;
public object Create(ActorInitializer init) { return new PaletteFromPng(init.World, this); }
public override object Create(ActorInitializer init) { return new PaletteFromPng(init.World, this); }
string IProvidesCursorPaletteInfo.Palette { get { return CursorPalette ? Name : null; } }

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Creates a single color palette without any base palette file.")]
class PaletteFromRGBAInfo : ITraitInfo
class PaletteFromRGBAInfo : TraitInfo
{
[PaletteDefinition]
[FieldLoader.Require]
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Index set to be fully transparent/invisible.")]
public readonly int TransparentIndex = 0;
public object Create(ActorInitializer init) { return new PaletteFromRGBA(init.World, this); }
public override object Create(ActorInitializer init) { return new PaletteFromRGBA(init.World, this); }
}
class PaletteFromRGBA : ILoadsPalettes

View File

@@ -19,9 +19,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Calculates routes for mobile units based on the A* search algorithm.", " Attach this to the world actor.")]
public class PathFinderInfo : ITraitInfo, Requires<LocomotorInfo>
public class PathFinderInfo : TraitInfo, Requires<LocomotorInfo>
{
public object Create(ActorInitializer init)
public override object Create(ActorInitializer init)
{
return new PathFinderUnitPathCacheDecorator(new PathFinder(init.World), new PathCacheStorage(init.World));
}

View File

@@ -16,14 +16,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class RadarPingsInfo : ITraitInfo
public class RadarPingsInfo : TraitInfo
{
public readonly int FromRadius = 200;
public readonly int ToRadius = 15;
public readonly int ShrinkSpeed = 4;
public readonly float RotationSpeed = 0.12f;
public object Create(ActorInitializer init) { return new RadarPings(this); }
public override object Create(ActorInitializer init) { return new RadarPings(this); }
}
public class RadarPings : ITick

View File

@@ -19,9 +19,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Attach this to the world actor.", "Order of the layers defines the Z sorting.")]
public class ResourceLayerInfo : ITraitInfo, Requires<ResourceTypeInfo>, Requires<BuildingInfluenceInfo>
public class ResourceLayerInfo : TraitInfo, Requires<ResourceTypeInfo>, Requires<BuildingInfluenceInfo>
{
public virtual object Create(ActorInitializer init) { return new ResourceLayer(init.Self); }
public override object Create(ActorInitializer init) { return new ResourceLayer(init.Self); }
}
public class ResourceLayer : IWorldLoaded

View File

@@ -18,13 +18,13 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Visualizes the state of the `ResourceLayer`.", " Attach this to the world actor.")]
public class ResourceRendererInfo : ITraitInfo, Requires<ResourceLayerInfo>
public class ResourceRendererInfo : TraitInfo, Requires<ResourceLayerInfo>
{
[FieldLoader.Require]
[Desc("Only render these ResourceType names.")]
public readonly string[] RenderTypes = null;
public virtual object Create(ActorInitializer init) { return new ResourceRenderer(init.Self, this); }
public override object Create(ActorInitializer init) { return new ResourceRenderer(init.Self, this); }
}
public class ResourceRenderer : IWorldLoaded, IRenderOverlay, ITickRender, INotifyActorDisposing

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class ResourceTypeInfo : ITraitInfo, IMapPreviewSignatureInfo
public class ResourceTypeInfo : TraitInfo, IMapPreviewSignatureInfo
{
[Desc("Sequence image that holds the different variants.")]
public readonly string Image = "resources";
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
public object Create(ActorInitializer init) { return new ResourceType(this, init.World); }
public override object Create(ActorInitializer init) { return new ResourceType(this, init.World); }
}
public class ResourceType : IWorldLoaded

View File

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Controls the map difficulty, tech level, and short game lobby options.")]
public class ScriptLobbyDropdownInfo : ITraitInfo, ILobbyOptions
public class ScriptLobbyDropdownInfo : TraitInfo, ILobbyOptions
{
[FieldLoader.Require]
[Desc("Internal id for this option.")]
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
new ReadOnlyDictionary<string, string>(Values), Default, Locked);
}
public object Create(ActorInitializer init) { return new ScriptLobbyDropdown(this); }
public override object Create(ActorInitializer init) { return new ScriptLobbyDropdown(this); }
}
public class ScriptLobbyDropdown : INotifyCreated

View File

@@ -17,9 +17,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class SelectionInfo : ITraitInfo
public class SelectionInfo : TraitInfo
{
public object Create(ActorInitializer init) { return new Selection(this); }
public override object Create(ActorInitializer init) { return new Selection(this); }
}
public class Selection : ISelection, INotifyCreated, INotifyOwnerChanged, ITick, IGameSaveTraitData

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class ShroudRendererInfo : ITraitInfo
public class ShroudRendererInfo : TraitInfo
{
public readonly string Sequence = "shroud";
[SequenceReference("Sequence")]
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int OverrideFogIndex = 15;
public readonly BlendMode ShroudBlend = BlendMode.Alpha;
public object Create(ActorInitializer init) { return new ShroudRenderer(init.World, this); }
public override object Create(ActorInitializer init) { return new ShroudRenderer(init.World, this); }
}
public sealed class ShroudRenderer : IRenderShroud, IWorldLoaded, INotifyActorDisposing

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
}
[Desc("Attach this to the world actor.", "Order of the layers defines the Z sorting.")]
public class SmudgeLayerInfo : ITraitInfo
public class SmudgeLayerInfo : TraitInfo
{
public readonly string Type = "Scorch";
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
return smudges;
}
public object Create(ActorInitializer init) { return new SmudgeLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new SmudgeLayer(init.Self, this); }
}
public class SmudgeLayer : IRenderOverlay, IWorldLoaded, ITickRender, INotifyActorDisposing

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Spawn base actor at the spawnpoint and support units in an annulus around the base actor. Both are defined at MPStartUnits. Attach this to the world actor.")]
public class SpawnMPUnitsInfo : ITraitInfo, Requires<MPStartLocationsInfo>, Requires<MPStartUnitsInfo>, ILobbyOptions
public class SpawnMPUnitsInfo : TraitInfo, Requires<MPStartLocationsInfo>, Requires<MPStartUnitsInfo>, ILobbyOptions
{
public readonly string StartingUnitsClass = "none";
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
new ReadOnlyDictionary<string, string>(startingUnits), StartingUnitsClass, DropdownLocked);
}
public object Create(ActorInitializer init) { return new SpawnMPUnits(this); }
public override object Create(ActorInitializer init) { return new SpawnMPUnits(this); }
}
public class SpawnMPUnits : IWorldLoaded

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
class StartGameNotificationInfo : ITraitInfo
class StartGameNotificationInfo : TraitInfo
{
[NotificationReference("Speech")]
public readonly string Notification = "StartGame";
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
public readonly string SavedNotification = "GameSaved";
public object Create(ActorInitializer init) { return new StartGameNotification(this); }
public override object Create(ActorInitializer init) { return new StartGameNotification(this); }
}
class StartGameNotification : IWorldLoaded, INotifyGameLoaded, INotifyGameSaved

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class SubterraneanActorLayerInfo : ITraitInfo
public class SubterraneanActorLayerInfo : TraitInfo
{
[Desc("Terrain type of the underground layer.")]
public readonly string TerrainType = "Subterranean";
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Cell radius for smoothing adjacent cell heights.")]
public readonly int SmoothingRadius = 2;
public object Create(ActorInitializer init) { return new SubterraneanActorLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new SubterraneanActorLayer(init.Self, this); }
}
public class SubterraneanActorLayer : ICustomMovementLayer

View File

@@ -15,9 +15,9 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class TerrainRendererInfo : ITraitInfo
public class TerrainRendererInfo : TraitInfo
{
public object Create(ActorInitializer init) { return new TerrainRenderer(init.World); }
public override object Create(ActorInitializer init) { return new TerrainRenderer(init.World); }
}
public sealed class TerrainRenderer : IRenderTerrain, IWorldLoaded, INotifyActorDisposing

View File

@@ -15,12 +15,12 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class TerrainTunnelLayerInfo : ITraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
public class TerrainTunnelLayerInfo : TraitInfo, Requires<DomainIndexInfo>, ILobbyCustomRulesIgnore
{
[Desc("Terrain type used by cells outside any tunnel footprint.")]
public readonly string ImpassableTerrainType = "Impassable";
public object Create(ActorInitializer init) { return new TerrainTunnelLayer(init.Self, this); }
public override object Create(ActorInitializer init) { return new TerrainTunnelLayer(init.Self, this); }
}
public class TerrainTunnelLayer : ICustomMovementLayer, IWorldLoaded

View File

@@ -18,11 +18,11 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Part of the combat overlay from DeveloperMode. Attach this to the world actor.")]
public class WarheadDebugOverlayInfo : ITraitInfo
public class WarheadDebugOverlayInfo : TraitInfo
{
public readonly int DisplayDuration = 25;
public object Create(ActorInitializer init) { return new WarheadDebugOverlay(this); }
public override object Create(ActorInitializer init) { return new WarheadDebugOverlay(this); }
}
public class WarheadDebugOverlay : IRenderAnnotations

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Adds a particle-based overlay.")]
public class WeatherOverlayInfo : ITraitInfo, ILobbyCustomRulesIgnore
public class WeatherOverlayInfo : TraitInfo, ILobbyCustomRulesIgnore
{
[Desc("Average number of particles per 100x100 px square.")]
public readonly int ParticleDensityFactor = 8;
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Works only with line enabled and can be used to fade out the tail of the line like a contrail.")]
public readonly byte LineTailAlphaValue = 200;
public object Create(ActorInitializer init) { return new WeatherOverlay(init.World, this); }
public override object Create(ActorInitializer init) { return new WeatherOverlay(init.World, this); }
}
public class WeatherOverlay : ITick, IRenderAboveWorld, INotifyViewportZoomExtentsChanged