Use expression body syntax
This commit is contained in:
@@ -51,6 +51,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
bool ISelectionBar.DisplayWhenEmpty => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
bool IRenderAnnotations.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotations.SpatiallyPartitionable => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteRenderable(n.Tile, n.Target.CenterPosition, WVec.Zero, -511, pal, 1f, 1f, float3.Ones, TintModifiers.IgnoreWorldTint, true);
|
||||
}
|
||||
|
||||
bool IRenderAboveShroud.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAboveShroud.SpatiallyPartitionable => false;
|
||||
|
||||
IEnumerable<IRenderable> IRenderAnnotationsWhenSelected.RenderAnnotations(Actor self, WorldRenderer wr)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return renderableCache.ToArray();
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
}
|
||||
|
||||
public static class LineTargetExts
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
bool ISelectionBar.DisplayWhenEmpty => false;
|
||||
|
||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
|
||||
@@ -54,6 +54,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
bool ISelectionBar.DisplayWhenEmpty => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
yield return new TextAnnotationRenderable(font, self.CenterPosition + offset, 0, color, aiSquadInfo);
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return true; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
info.BorderWidth);
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
|
||||
void ITick.Tick(Actor self)
|
||||
{
|
||||
|
||||
@@ -84,6 +84,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +123,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return RangeCircleRenderables(wr);
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return RangeCircleRenderables(self, wr);
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,13 +118,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
PaletteReference = null;
|
||||
}
|
||||
|
||||
public bool IsVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
return Animation.DisableFunc == null || !Animation.DisableFunc();
|
||||
}
|
||||
}
|
||||
public bool IsVisible => Animation.DisableFunc == null || !Animation.DisableFunc();
|
||||
|
||||
public bool Tick()
|
||||
{
|
||||
|
||||
@@ -164,7 +164,8 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
yield return c.ScreenBounds(pos, wr, Info.Scale);
|
||||
}
|
||||
|
||||
public string Image { get { return Info.Image ?? self.Info.Name; } }
|
||||
public string Image => Info.Image ?? self.Info.Name;
|
||||
|
||||
public void Add(ModelAnimation m)
|
||||
{
|
||||
components.Add(m);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return DrawDecorations(self, wr);
|
||||
}
|
||||
|
||||
bool IRenderAnnotations.SpatiallyPartitionable { get { return true; } }
|
||||
bool IRenderAnnotations.SpatiallyPartitionable => true;
|
||||
|
||||
IEnumerable<IRenderable> DrawDecorations(Actor self, WorldRenderer wr)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
bool ISelectionBar.DisplayWhenEmpty => false;
|
||||
|
||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
value = duration > 0 ? remaining * 1f / duration : 0;
|
||||
}
|
||||
|
||||
string IConditionTimerWatcher.Condition { get { return info.Condition; } }
|
||||
string IConditionTimerWatcher.Condition => info.Condition;
|
||||
|
||||
float ISelectionBar.GetValue()
|
||||
{
|
||||
@@ -54,6 +54,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return info.Color; }
|
||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||
bool ISelectionBar.DisplayWhenEmpty => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,9 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
Sprite IProductionIconOverlay.Sprite { get { return sprite; } }
|
||||
string IProductionIconOverlay.Palette { get { return info.Palette; } }
|
||||
Sprite IProductionIconOverlay.Sprite => sprite;
|
||||
string IProductionIconOverlay.Palette => info.Palette;
|
||||
|
||||
float2 IProductionIconOverlay.Offset(float2 iconSize)
|
||||
{
|
||||
var x = (sprite.Size.X - iconSize.X) / 2;
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IDecoration.RequiresSelection { get { return Info.RequiresSelection; } }
|
||||
bool IDecoration.RequiresSelection => Info.RequiresSelection;
|
||||
|
||||
protected abstract IEnumerable<IRenderable> RenderDecoration(Actor self, WorldRenderer wr, int2 pos);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
AnimationState state;
|
||||
IRenderInfantrySequenceModifier rsm;
|
||||
|
||||
bool IsModifyingSequence { get { return rsm != null && rsm.IsModifyingSequence; } }
|
||||
bool IsModifyingSequence => rsm != null && rsm.IsModifyingSequence;
|
||||
bool wasModifying;
|
||||
|
||||
// Allow subclasses to override the info that we use for rendering
|
||||
|
||||
@@ -113,13 +113,13 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return RenderRangeCircle(self, wr, RangeCircleVisibility.WhenSelected);
|
||||
}
|
||||
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotationsWhenSelected.SpatiallyPartitionable => false;
|
||||
|
||||
IEnumerable<IRenderable> IRenderAnnotations.RenderAnnotations(Actor self, WorldRenderer wr)
|
||||
{
|
||||
return RenderRangeCircle(self, wr, RangeCircleVisibility.Always);
|
||||
}
|
||||
|
||||
bool IRenderAnnotations.SpatiallyPartitionable { get { return false; } }
|
||||
bool IRenderAnnotations.SpatiallyPartitionable => false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
anim = new Animation(self.World, Info.Image);
|
||||
}
|
||||
|
||||
bool IDecoration.RequiresSelection { get { return true; } }
|
||||
bool IDecoration.RequiresSelection => true;
|
||||
|
||||
IEnumerable<IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
label = new CachedTransform<int, string>(g => g.ToString());
|
||||
}
|
||||
|
||||
bool IDecoration.RequiresSelection { get { return true; } }
|
||||
bool IDecoration.RequiresSelection => true;
|
||||
|
||||
IEnumerable<IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user