Fix CA1012
This commit is contained in:
@@ -616,6 +616,9 @@ dotnet_code_quality.api_surface = all
|
|||||||
#dotnet_code_quality.CA1010.additional_required_generic_interfaces =
|
#dotnet_code_quality.CA1010.additional_required_generic_interfaces =
|
||||||
dotnet_diagnostic.CA1010.severity = warning
|
dotnet_diagnostic.CA1010.severity = warning
|
||||||
|
|
||||||
|
# Abstract types should not have public constructors.
|
||||||
|
dotnet_diagnostic.CA1012.severity = warning
|
||||||
|
|
||||||
# Mark attributes with 'AttributeUsageAttribute'.
|
# Mark attributes with 'AttributeUsageAttribute'.
|
||||||
dotnet_diagnostic.CA1018.severity = warning
|
dotnet_diagnostic.CA1018.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace OpenRA.Activities
|
|||||||
bool firstRunCompleted;
|
bool firstRunCompleted;
|
||||||
bool lastRun;
|
bool lastRun;
|
||||||
|
|
||||||
public Activity()
|
protected Activity()
|
||||||
{
|
{
|
||||||
IsInterruptible = true;
|
IsInterruptible = true;
|
||||||
ChildHasPriority = true;
|
ChildHasPriority = true;
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ namespace OpenRA
|
|||||||
protected readonly T[] Entries;
|
protected readonly T[] Entries;
|
||||||
protected readonly Rectangle Bounds;
|
protected readonly Rectangle Bounds;
|
||||||
|
|
||||||
public CellLayerBase(Map map)
|
protected CellLayerBase(Map map)
|
||||||
: this(map.Grid.Type, new Size(map.MapSize.X, map.MapSize.Y)) { }
|
: this(map.Grid.Type, new Size(map.MapSize.X, map.MapSize.Y)) { }
|
||||||
|
|
||||||
public CellLayerBase(MapGridType gridType, Size size)
|
protected CellLayerBase(MapGridType gridType, Size size)
|
||||||
{
|
{
|
||||||
Size = size;
|
Size = size;
|
||||||
Bounds = new Rectangle(0, 0, Size.Width, Size.Height);
|
Bounds = new Rectangle(0, 0, Size.Width, Size.Height);
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ namespace OpenRA.Scripting
|
|||||||
{
|
{
|
||||||
protected readonly Actor Self;
|
protected readonly Actor Self;
|
||||||
protected readonly ScriptContext Context;
|
protected readonly ScriptContext Context;
|
||||||
public ScriptActorProperties(ScriptContext context, Actor self)
|
|
||||||
|
protected ScriptActorProperties(ScriptContext context, Actor self)
|
||||||
{
|
{
|
||||||
Self = self;
|
Self = self;
|
||||||
Context = context;
|
Context = context;
|
||||||
@@ -61,7 +62,8 @@ namespace OpenRA.Scripting
|
|||||||
{
|
{
|
||||||
protected readonly Player Player;
|
protected readonly Player Player;
|
||||||
protected readonly ScriptContext Context;
|
protected readonly ScriptContext Context;
|
||||||
public ScriptPlayerProperties(ScriptContext context, Player player)
|
|
||||||
|
protected ScriptPlayerProperties(ScriptContext context, Player player)
|
||||||
{
|
{
|
||||||
Player = player;
|
Player = player;
|
||||||
Context = context;
|
Context = context;
|
||||||
@@ -87,7 +89,8 @@ namespace OpenRA.Scripting
|
|||||||
protected override string MemberNotFoundError(string memberName) { return $"Table '{Name}' does not define a property '{memberName}'"; }
|
protected override string MemberNotFoundError(string memberName) { return $"Table '{Name}' does not define a property '{memberName}'"; }
|
||||||
|
|
||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
public ScriptGlobal(ScriptContext context)
|
|
||||||
|
protected ScriptGlobal(ScriptContext context)
|
||||||
: base(context)
|
: base(context)
|
||||||
{
|
{
|
||||||
// GetType resolves the actual (subclass) type
|
// GetType resolves the actual (subclass) type
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace OpenRA.Scripting
|
|||||||
readonly List<string> membersToRemove = new List<string>();
|
readonly List<string> membersToRemove = new List<string>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public ScriptObjectWrapper(ScriptContext context)
|
protected ScriptObjectWrapper(ScriptContext context)
|
||||||
{
|
{
|
||||||
Context = context;
|
Context = context;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ namespace OpenRA.Support
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableExpression(string expression)
|
protected VariableExpression(string expression)
|
||||||
{
|
{
|
||||||
Expression = expression;
|
Expression = expression;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,9 +204,10 @@ namespace OpenRA.Widgets
|
|||||||
public Rectangle Bounds;
|
public Rectangle Bounds;
|
||||||
public Widget Parent = null;
|
public Widget Parent = null;
|
||||||
public Func<bool> IsVisible;
|
public Func<bool> IsVisible;
|
||||||
public Widget() { IsVisible = () => Visible; }
|
|
||||||
|
|
||||||
public Widget(Widget widget)
|
protected Widget() { IsVisible = () => Visible; }
|
||||||
|
|
||||||
|
protected Widget(Widget widget)
|
||||||
{
|
{
|
||||||
Id = widget.Id;
|
Id = widget.Id;
|
||||||
X = widget.X;
|
X = widget.X;
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
readonly int terrainOrientationMargin;
|
readonly int terrainOrientationMargin;
|
||||||
protected int progress;
|
protected int progress;
|
||||||
|
|
||||||
public MovePart(Move move, WPos from, WPos to, WAngle fromFacing, WAngle toFacing,
|
protected MovePart(Move move, WPos from, WPos to, WAngle fromFacing, WAngle toFacing,
|
||||||
WRot? fromTerrainOrientation, WRot? toTerrainOrientation, int terrainOrientationMargin,
|
WRot? fromTerrainOrientation, WRot? toTerrainOrientation, int terrainOrientationMargin,
|
||||||
int carryoverProgress, bool shouldArc, bool movingOnGroundLayer)
|
int carryoverProgress, bool shouldArc, bool movingOnGroundLayer)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Orders
|
|||||||
{
|
{
|
||||||
readonly string order;
|
readonly string order;
|
||||||
|
|
||||||
public GlobalButtonOrderGenerator(string order)
|
protected GlobalButtonOrderGenerator(string order)
|
||||||
{
|
{
|
||||||
this.order = order;
|
this.order = order;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Orders
|
|||||||
readonly string cursor;
|
readonly string cursor;
|
||||||
readonly bool targetEnemyUnits, targetAllyUnits;
|
readonly bool targetEnemyUnits, targetAllyUnits;
|
||||||
|
|
||||||
public UnitOrderTargeter(string order, int priority, string cursor, bool targetEnemyUnits, bool targetAllyUnits)
|
protected UnitOrderTargeter(string order, int priority, string cursor, bool targetEnemyUnits, bool targetAllyUnits)
|
||||||
{
|
{
|
||||||
OrderID = order;
|
OrderID = order;
|
||||||
OrderPriority = priority;
|
OrderPriority = priority;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected abstract void AddCellsToPlayerShroud(Actor self, Player player, PPos[] uv);
|
protected abstract void AddCellsToPlayerShroud(Actor self, Player player, PPos[] uv);
|
||||||
protected abstract void RemoveCellsFromPlayerShroud(Actor self, Player player);
|
protected abstract void RemoveCellsFromPlayerShroud(Actor self, Player player);
|
||||||
|
|
||||||
public AffectsShroud(AffectsShroudInfo info)
|
protected AffectsShroud(AffectsShroudInfo info)
|
||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
if (Info.Type == VisibilityType.Footprint)
|
if (Info.Type == VisibilityType.Footprint)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
bool wasAiming;
|
bool wasAiming;
|
||||||
|
|
||||||
public AttackBase(Actor self, AttackBaseInfo info)
|
protected AttackBase(Actor self, AttackBaseInfo info)
|
||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.self = self;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Sync]
|
[Sync]
|
||||||
public bool IsTraitDisabled { get; private set; }
|
public bool IsTraitDisabled { get; private set; }
|
||||||
|
|
||||||
public ConditionalTrait(InfoType info)
|
protected ConditionalTrait(InfoType info)
|
||||||
{
|
{
|
||||||
Info = info;
|
Info = info;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected readonly byte ValidLayerType;
|
protected readonly byte ValidLayerType;
|
||||||
protected int conditionToken = Actor.InvalidConditionToken;
|
protected int conditionToken = Actor.InvalidConditionToken;
|
||||||
|
|
||||||
public GrantConditionOnLayer(InfoType info, byte validLayer)
|
protected GrantConditionOnLayer(InfoType info, byte validLayer)
|
||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
ValidLayerType = validLayer;
|
ValidLayerType = validLayer;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
DeveloperMode developerMode;
|
DeveloperMode developerMode;
|
||||||
|
|
||||||
public SelectionDecorationsBase(SelectionDecorationsBaseInfo info)
|
protected SelectionDecorationsBase(SelectionDecorationsBaseInfo info)
|
||||||
{
|
{
|
||||||
Info = info;
|
Info = info;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
int2 conditionalOffset;
|
int2 conditionalOffset;
|
||||||
BlinkState[] blinkPattern;
|
BlinkState[] blinkPattern;
|
||||||
|
|
||||||
public WithDecorationBase(Actor self, InfoType info)
|
protected WithDecorationBase(Actor self, InfoType info)
|
||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
Self = self;
|
Self = self;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Sort order for the support power palette. Smaller numbers are presented earlier.")]
|
[Desc("Sort order for the support power palette. Smaller numbers are presented earlier.")]
|
||||||
public readonly int SupportPowerPaletteOrder = 9999;
|
public readonly int SupportPowerPaletteOrder = 9999;
|
||||||
|
|
||||||
public SupportPowerInfo() { OrderName = GetType().Name + "Order"; }
|
protected SupportPowerInfo() { OrderName = GetType().Name + "Order"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SupportPower : PausableConditionalTrait<SupportPowerInfo>
|
public class SupportPower : PausableConditionalTrait<SupportPowerInfo>
|
||||||
|
|||||||
@@ -569,7 +569,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
public readonly int DisplayOrder;
|
public readonly int DisplayOrder;
|
||||||
|
|
||||||
public EditorActorOption(string name, int displayOrder)
|
protected EditorActorOption(string name, int displayOrder)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
DisplayOrder = displayOrder;
|
DisplayOrder = displayOrder;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
protected string[] allCategories;
|
protected string[] allCategories;
|
||||||
protected string searchFilter;
|
protected string searchFilter;
|
||||||
|
|
||||||
public CommonSelectorLogic(Widget widget, ModData modData, World world, WorldRenderer worldRenderer, string templateListId, string previewTemplateId)
|
protected CommonSelectorLogic(Widget widget, ModData modData, World world, WorldRenderer worldRenderer, string templateListId, string previewTemplateId)
|
||||||
{
|
{
|
||||||
Widget = widget;
|
Widget = widget;
|
||||||
ModData = modData;
|
ModData = modData;
|
||||||
|
|||||||
Reference in New Issue
Block a user