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

@@ -179,7 +179,7 @@ namespace OpenRA.Mods.Common.Traits
public IReadOnlyDictionary<CPos, SubCell> OccupiedCells(ActorInfo info, CPos location, SubCell subCell = SubCell.Any) { return new ReadOnlyDictionary<CPos, SubCell>(); }
bool IOccupySpaceInfo.SharesCell { get { return false; } }
bool IOccupySpaceInfo.SharesCell => false;
// Used to determine if an aircraft can spawn landed
public bool CanEnterCell(World world, Actor self, CPos cell, SubCell subCell = SubCell.FullCell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
@@ -232,30 +232,30 @@ namespace OpenRA.Mods.Common.Traits
[Sync]
public WAngle Facing
{
get { return orientation.Yaw; }
set { orientation = orientation.WithYaw(value); }
get => orientation.Yaw;
set => orientation = orientation.WithYaw(value);
}
public WAngle Pitch
{
get { return orientation.Pitch; }
set { orientation = orientation.WithPitch(value); }
get => orientation.Pitch;
set => orientation = orientation.WithPitch(value);
}
public WAngle Roll
{
get { return orientation.Roll; }
set { orientation = orientation.WithRoll(value); }
get => orientation.Roll;
set => orientation = orientation.WithRoll(value);
}
public WRot Orientation { get { return orientation; } }
public WRot Orientation => orientation;
[Sync]
public WPos CenterPosition { get; private set; }
public CPos TopLeft { get { return self.World.Map.CellContaining(CenterPosition); } }
public WAngle TurnSpeed { get { return !IsTraitDisabled && !IsTraitPaused ? Info.TurnSpeed : WAngle.Zero; } }
public WAngle? IdleTurnSpeed { get { return Info.IdleTurnSpeed; } }
public CPos TopLeft => self.World.Map.CellContaining(CenterPosition);
public WAngle TurnSpeed => !IsTraitDisabled && !IsTraitPaused ? Info.TurnSpeed : WAngle.Zero;
public WAngle? IdleTurnSpeed => Info.IdleTurnSpeed;
public Actor ReservedActor { get; private set; }
public bool MayYieldReservation { get; private set; }
@@ -272,7 +272,7 @@ namespace OpenRA.Mods.Common.Traits
return self.CenterPosition - new WVec(WDist.Zero, WDist.Zero, self.World.Map.DistanceAboveTerrain(self.CenterPosition));
}
public bool AtLandAltitude { get { return self.World.Map.DistanceAboveTerrain(GetPosition()) == LandAltitude; } }
public bool AtLandAltitude => self.World.Map.DistanceAboveTerrain(GetPosition()) == LandAltitude;
bool airborne;
bool cruising;
@@ -595,10 +595,7 @@ namespace OpenRA.Mods.Common.Traits
return allowedToEnterRearmer || allowedToEnterRepairer;
}
public int MovementSpeed
{
get { return !IsTraitDisabled && !IsTraitPaused ? Util.ApplyPercentageModifiers(Info.Speed, speedModifiers) : 0; }
}
public int MovementSpeed => !IsTraitDisabled && !IsTraitPaused ? Util.ApplyPercentageModifiers(Info.Speed, speedModifiers) : 0;
public (CPos Cell, SubCell SubCell)[] OccupiedCells()
{
@@ -967,10 +964,7 @@ namespace OpenRA.Mods.Common.Traits
public MovementType CurrentMovementTypes
{
get
{
return movementTypes;
}
get => movementTypes;
set
{
@@ -1247,7 +1241,7 @@ namespace OpenRA.Mods.Common.Traits
readonly Aircraft aircraft;
public string OrderID { get; protected set; }
public int OrderPriority { get { return 4; } }
public int OrderPriority => 4;
public bool IsQueued { get; protected set; }
public AircraftMoveOrderTargeter(Aircraft aircraft)