Use expression body syntax

This commit is contained in:
teinarss
2021-02-25 20:52:13 +01:00
committed by Paul Chote
parent 555c43843b
commit 4a1e4f3e16
403 changed files with 1342 additions and 2031 deletions

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Pathfinder
public abstract IEnumerable<(CPos Cell, int Cost)> Considered { get; }
public Player Owner { get { return Graph.Actor.Owner; } }
public Player Owner => Graph.Actor.Owner;
public int MaxCost { get; protected set; }
public bool Debug { get; set; }
protected Func<CPos, int> heuristic;
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Pathfinder
return isGoal(location);
}
public bool CanExpand { get { return !OpenQueue.Empty; } }
public bool CanExpand => !OpenQueue.Empty;
public abstract CPos Expand();
protected virtual void Dispose(bool disposing)

View File

@@ -222,8 +222,8 @@ namespace OpenRA.Mods.Common.Pathfinder
public CellInfo this[CPos pos]
{
get { return (pos.Layer == 0 ? groundInfo : customLayerInfo[pos.Layer].Info)[pos]; }
set { (pos.Layer == 0 ? groundInfo : customLayerInfo[pos.Layer].Info)[pos] = value; }
get => (pos.Layer == 0 ? groundInfo : customLayerInfo[pos.Layer].Info)[pos];
set => (pos.Layer == 0 ? groundInfo : customLayerInfo[pos.Layer].Info)[pos] = value;
}
public void Dispose()

View File

@@ -30,10 +30,7 @@ namespace OpenRA.Mods.Common.Pathfinder
return LayerPoolTable.GetValue(world, CreateLayerPool);
}
public override IEnumerable<(CPos, int)> Considered
{
get { return considered; }
}
public override IEnumerable<(CPos, int)> Considered => considered;
LinkedList<(CPos, int)> considered;