Remove constructor base() redundancies

This commit is contained in:
ScottNZ
2013-11-12 17:31:55 +13:00
parent 7c5f3cc0f1
commit 86a3e14f2d
32 changed files with 20 additions and 34 deletions

View File

@@ -107,7 +107,6 @@ namespace OpenRA.Editor
public Dictionary<int2, Bitmap> Chunks = new Dictionary<int2, Bitmap>(); public Dictionary<int2, Bitmap> Chunks = new Dictionary<int2, Bitmap>();
public Surface() public Surface()
: base()
{ {
BackColor = Color.Black; BackColor = Color.Black;

View File

@@ -23,7 +23,7 @@ namespace OpenRA.FileFormats.Primitives
public event Action<object, object> OnSet = (o, n) => { }; public event Action<object, object> OnSet = (o, n) => { };
public event Action OnRefresh = () => { }; public event Action OnRefresh = () => { };
public ObservableCollection() : base() { } public ObservableCollection() { }
public ObservableCollection(IList<T> list) : base(list) { } public ObservableCollection(IList<T> list) : base(list) { }
protected override void SetItem(int index, T item) protected override void SetItem(int index, T item)

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Widgets
WidgetUtils.DrawPanel(Background, RenderBounds); WidgetUtils.DrawPanel(Background, RenderBounds);
} }
public BackgroundWidget() : base() { } public BackgroundWidget() { }
bool moving; bool moving;
int2? prevMouseLocation; int2? prevMouseLocation;

View File

@@ -48,7 +48,6 @@ namespace OpenRA.Widgets
public Action<KeyInput> OnKeyPress = _ => {}; public Action<KeyInput> OnKeyPress = _ => {};
public ButtonWidget() public ButtonWidget()
: base()
{ {
GetText = () => { return Text; }; GetText = () => { return Text; };
OnMouseUp = _ => OnClick(); OnMouseUp = _ => OnClick();

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Widgets
internal List<ChatLine> recentLines = new List<ChatLine>(); internal List<ChatLine> recentLines = new List<ChatLine>();
public ChatDisplayWidget() public ChatDisplayWidget()
: base() { } { }
public override Rectangle EventBounds { get { return Rectangle.Empty; } } public override Rectangle EventBounds { get { return Rectangle.Empty; } }

View File

@@ -25,7 +25,6 @@ namespace OpenRA.Widgets
public bool HasPressedState = ChromeMetrics.Get<bool>("CheckboxPressedState"); public bool HasPressedState = ChromeMetrics.Get<bool>("CheckboxPressedState");
public CheckboxWidget() public CheckboxWidget()
: base()
{ {
GetCheckType = () => CheckType; GetCheckType = () => CheckType;
} }

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Widgets
OrderManager orderManager; OrderManager orderManager;
int clientIndex; int clientIndex;
public ClientTooltipRegionWidget() : base() public ClientTooltipRegionWidget()
{ {
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }

View File

@@ -18,7 +18,6 @@ namespace OpenRA.Widgets
public Func<Color> GetColor; public Func<Color> GetColor;
public ColorBlockWidget() public ColorBlockWidget()
: base()
{ {
GetColor = () => Color.White; GetColor = () => Color.White;
} }

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Widgets
Widget panel; Widget panel;
MaskWidget fullscreenMask; MaskWidget fullscreenMask;
public DropDownButtonWidget() : base() { } public DropDownButtonWidget() { }
protected DropDownButtonWidget(DropDownButtonWidget widget) : base(widget) { } protected DropDownButtonWidget(DropDownButtonWidget widget) : base(widget) { }
@@ -145,7 +145,7 @@ namespace OpenRA.Widgets
public class MaskWidget : Widget public class MaskWidget : Widget
{ {
public event Action<MouseInput> OnMouseDown = _ => {}; public event Action<MouseInput> OnMouseDown = _ => {};
public MaskWidget() : base() { } public MaskWidget() { }
public MaskWidget(MaskWidget other) public MaskWidget(MaskWidget other)
: base(other) : base(other)
{ {

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Widgets
public Color DisabledColor = Color.Gray; public Color DisabledColor = Color.Gray;
public string Font = "Regular"; public string Font = "Regular";
public HotkeyEntryWidget() : base() {} public HotkeyEntryWidget() {}
protected HotkeyEntryWidget(HotkeyEntryWidget widget) protected HotkeyEntryWidget(HotkeyEntryWidget widget)
: base(widget) : base(widget)
{ {

View File

@@ -21,7 +21,6 @@ namespace OpenRA.Widgets
public Func<string> GetImageCollection; public Func<string> GetImageCollection;
public ImageWidget() public ImageWidget()
: base()
{ {
GetImageName = () => ImageName; GetImageName = () => ImageName;
GetImageCollection = () => ImageCollection; GetImageCollection = () => ImageCollection;

View File

@@ -33,7 +33,6 @@ namespace OpenRA.Widgets
public Func<Color> GetContrastColor; public Func<Color> GetContrastColor;
public LabelWidget() public LabelWidget()
: base()
{ {
GetText = () => Text; GetText = () => Text;
GetColor = () => Color; GetColor = () => Color;

View File

@@ -41,7 +41,6 @@ namespace OpenRA.Widgets
public string AxisFont; public string AxisFont;
public LineGraphWidget() public LineGraphWidget()
: base()
{ {
GetValueFormat = () => ValueFormat; GetValueFormat = () => ValueFormat;
GetXAxisValueFormat = () => XAxisValueFormat; GetXAxisValueFormat = () => XAxisValueFormat;

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Widgets
Lazy<TooltipContainerWidget> tooltipContainer; Lazy<TooltipContainerWidget> tooltipContainer;
public int TooltipSpawnIndex = -1; public int TooltipSpawnIndex = -1;
public MapPreviewWidget() : base() public MapPreviewWidget()
{ {
tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer)); tooltipContainer = Lazy.New(() => Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
} }

View File

@@ -12,7 +12,7 @@ namespace OpenRA.Widgets
{ {
public class PasswordFieldWidget : TextFieldWidget public class PasswordFieldWidget : TextFieldWidget
{ {
public PasswordFieldWidget() : base() { } public PasswordFieldWidget() { }
protected PasswordFieldWidget(PasswordFieldWidget widget) : base(widget) { } protected PasswordFieldWidget(PasswordFieldWidget widget) : base(widget) { }
protected override string GetApparentText() { return new string('*', Text.Length); } protected override string GetApparentText() { return new string('*', Text.Length); }

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Widgets
{ {
public class PerfGraphWidget : Widget public class PerfGraphWidget : Widget
{ {
public PerfGraphWidget() : base() { } public PerfGraphWidget() { }
public override void Draw() public override void Draw()
{ {

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Widgets
float offset = 0f; float offset = 0f;
float tickStep = 0.04f; float tickStep = 0.04f;
public ProgressBarWidget() : base() {} public ProgressBarWidget() {}
protected ProgressBarWidget(ProgressBarWidget widget) protected ProgressBarWidget(ProgressBarWidget widget)
: base(widget) : base(widget)
{ {

View File

@@ -18,7 +18,6 @@ namespace OpenRA.Widgets
public string BaseName = "scrollitem"; public string BaseName = "scrollitem";
public ScrollItemWidget() public ScrollItemWidget()
: base()
{ {
IsVisible = () => false; IsVisible = () => false;
VisualHeight = 0; VisualHeight = 0;

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Widgets
protected Rectangle scrollbarRect; protected Rectangle scrollbarRect;
protected Rectangle thumbRect; protected Rectangle thumbRect;
public ScrollPanelWidget() : base() { Layout = new ListLayout(this); } public ScrollPanelWidget() { Layout = new ListLayout(this); }
public override void RemoveChildren() public override void RemoveChildren()
{ {

View File

@@ -28,7 +28,6 @@ namespace OpenRA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ShpImageWidget(WorldRenderer worldRenderer) public ShpImageWidget(WorldRenderer worldRenderer)
: base()
{ {
GetImage = () => { return Image; }; GetImage = () => { return Image; };
GetFrame = () => { return Frame; }; GetFrame = () => { return Frame; };

View File

@@ -29,7 +29,6 @@ namespace OpenRA.Widgets
protected bool isMoving = false; protected bool isMoving = false;
public SliderWidget() public SliderWidget()
: base()
{ {
GetValue = () => Value; GetValue = () => Value;
} }

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Widgets
public Color DisabledColor = Color.Gray; public Color DisabledColor = Color.Gray;
public string Font = "Regular"; public string Font = "Regular";
public TextFieldWidget() : base() {} public TextFieldWidget() {}
protected TextFieldWidget(TextFieldWidget widget) protected TextFieldWidget(TextFieldWidget widget)
: base(widget) : base(widget)
{ {

View File

@@ -61,7 +61,6 @@ namespace OpenRA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ViewportControllerWidget(World world, WorldRenderer worldRenderer) public ViewportControllerWidget(World world, WorldRenderer worldRenderer)
: base()
{ {
this.world = world; this.world = world;
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;

View File

@@ -446,7 +446,7 @@ namespace OpenRA.Widgets
public class ContainerWidget : Widget public class ContainerWidget : Widget
{ {
public ContainerWidget() : base() { IgnoreMouseOver = true; } public ContainerWidget() { IgnoreMouseOver = true; }
public ContainerWidget(ContainerWidget other) public ContainerWidget(ContainerWidget other)
: base(other) { IgnoreMouseOver = true; } : base(other) { IgnoreMouseOver = true; }
@@ -458,7 +458,7 @@ namespace OpenRA.Widgets
public class WidgetArgs : Dictionary<string, object> public class WidgetArgs : Dictionary<string, object>
{ {
public WidgetArgs() : base() { } public WidgetArgs() { }
public WidgetArgs(Dictionary<string, object> args) : base(args) { } public WidgetArgs(Dictionary<string, object> args) : base(args) { }
public void Add(string key, Action val) { base.Add(key, val); } public void Add(string key, Action val) { base.Add(key, val); }
} }

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{ {
public readonly string ProductionGroup; public readonly string ProductionGroup;
public ProductionTypeButtonWidget() : base() { } public ProductionTypeButtonWidget() { }
protected ProductionTypeButtonWidget(ProductionTypeButtonWidget other) protected ProductionTypeButtonWidget(ProductionTypeButtonWidget other)
: base(other) : base(other)
{ {

View File

@@ -12,7 +12,7 @@ namespace OpenRA.Mods.RA.AI
{ {
class RushFuzzy : AttackOrFleeFuzzy class RushFuzzy : AttackOrFleeFuzzy
{ {
public RushFuzzy() : base() { } public RushFuzzy() { }
protected override void AddingRulesForNormalOwnHealth() protected override void AddingRulesForNormalOwnHealth()
{ {

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA.Widgets
Thread workerThread; Thread workerThread;
bool workerAlive; bool workerAlive;
public ColorMixerWidget() : base() {} public ColorMixerWidget() {}
public ColorMixerWidget(ColorMixerWidget other) public ColorMixerWidget(ColorMixerWidget other)
: base(other) : base(other)
{ {

View File

@@ -31,7 +31,6 @@ namespace OpenRA.Mods.RA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ColorPreviewManagerWidget(WorldRenderer worldRenderer) public ColorPreviewManagerWidget(WorldRenderer worldRenderer)
: base()
{ {
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;
} }

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Widgets
Bitmap hueBitmap; Bitmap hueBitmap;
Sprite hueSprite; Sprite hueSprite;
public HueSliderWidget() : base() {} public HueSliderWidget() {}
public HueSliderWidget(HueSliderWidget other) : base(other) {} public HueSliderWidget(HueSliderWidget other) : base(other) {}
public override void Initialize(WidgetArgs args) public override void Initialize(WidgetArgs args)

View File

@@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ObserverProductionIconsWidget(World world, WorldRenderer worldRenderer) public ObserverProductionIconsWidget(World world, WorldRenderer worldRenderer)
: base()
{ {
this.world = world; this.world = world;
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;

View File

@@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA.Widgets
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ObserverSupportPowerIconsWidget(World world, WorldRenderer worldRenderer) public ObserverSupportPowerIconsWidget(World world, WorldRenderer worldRenderer)
: base()
{ {
this.world = world; this.world = world;

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Widgets
int2 offset; int2 offset;
int frame; int frame;
public SlidingContainerWidget() : base() { } public SlidingContainerWidget() { }
public override void Initialize(WidgetArgs args) public override void Initialize(WidgetArgs args)
{ {
base.Initialize(args); base.Initialize(args);