Clean up some warnings (#6088)

* Clean up some warnings

* Remove nullable enable

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
wrexbe
2022-01-09 20:10:36 -08:00
committed by GitHub
parent 03c56bf23e
commit 5ceb2372bf
37 changed files with 126 additions and 119 deletions

View File

@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -22,9 +22,9 @@ namespace Content.Tools
Root = stream.Documents[0].RootNode;
TilemapNode = (YamlMappingNode) Root["tilemap"];
GridsNode = (YamlSequenceNode) Root["grids"];
_entitiesNode = (YamlSequenceNode) Root["entities"];
EntitiesNode = (YamlSequenceNode) Root["entities"];
foreach (var entity in _entitiesNode)
foreach (var entity in EntitiesNode)
{
var uid = uint.Parse(entity["uid"].AsString());
if (uid >= NextAvailableEntityId)
@@ -47,7 +47,7 @@ namespace Content.Tools
// Entities lookup
private YamlSequenceNode _entitiesNode { get; }
private YamlSequenceNode EntitiesNode { get; }
public Dictionary<uint, YamlMappingNode> Entities { get; } = new Dictionary<uint, YamlMappingNode>();
@@ -60,9 +60,9 @@ namespace Content.Tools
public void Save(string fileName)
{
// Update entities node
_entitiesNode.Children.Clear();
EntitiesNode.Children.Clear();
foreach (var kvp in Entities)
_entitiesNode.Add(kvp.Value);
EntitiesNode.Add(kvp.Value);
using var writer = new StreamWriter(fileName);
var document = new YamlDocument(Root);