Switch other struct types to default(T).

This commit is contained in:
Paul Chote
2019-06-07 21:28:38 +01:00
committed by abcdefg30
parent dba1301b61
commit ebd36891dc
13 changed files with 15 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
public class ResourceLayer : IRenderOverlay, IWorldLoaded, ITickRender, INotifyActorDisposing
{
static readonly CellContents EmptyCell = new CellContents();
static readonly CellContents EmptyCell = default(CellContents);
readonly World world;
readonly BuildingInfluence buildingInfluence;
@@ -310,7 +310,7 @@ namespace OpenRA.Mods.Common.Traits
public struct CellContents
{
public static readonly CellContents Empty = new CellContents();
public static readonly CellContents Empty = default(CellContents);
public ResourceType Type;
public int Density;
public string Variant;

View File

@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Traits
if (!world.Map.Contains(loc))
return;
var tile = dirty.ContainsKey(loc) ? dirty[loc] : new Smudge();
var tile = dirty.ContainsKey(loc) ? dirty[loc] : default(Smudge);
// Setting Sprite to null to indicate a deleted smudge.
tile.Sprite = null;