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

@@ -25,13 +25,13 @@ namespace OpenRA
public readonly int Bits;
// X is padded to MSB, so bit shift does the correct sign extension
public int X { get { return Bits >> 20; } }
public int X => Bits >> 20;
// Align Y with a short, cast, then shift the rest of the way
// The signed short bit shift does the correct sign extension
public int Y { get { return ((short)(Bits >> 4)) >> 4; } }
public int Y => ((short)(Bits >> 4)) >> 4;
public byte Layer { get { return (byte)Bits; } }
public byte Layer => (byte)Bits;
public CPos(int bits) { Bits = bits; }
public CPos(int x, int y)
@@ -136,10 +136,7 @@ namespace OpenRA
}
}
set
{
throw new LuaException("CPos is read-only. Use CPos.New to create a new value");
}
set => throw new LuaException("CPos is read-only. Use CPos.New to create a new value");
}
#endregion