From 466b7a4c0becee086203def1df9d2c8cfc902af6 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 27 Oct 2024 08:38:47 +0000 Subject: [PATCH] Change GetProperty return to be nullable --- KeepersCompound.LGS/Database/ObjectHierarchy.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/KeepersCompound.LGS/Database/ObjectHierarchy.cs b/KeepersCompound.LGS/Database/ObjectHierarchy.cs index 7bd9827..ab92db4 100644 --- a/KeepersCompound.LGS/Database/ObjectHierarchy.cs +++ b/KeepersCompound.LGS/Database/ObjectHierarchy.cs @@ -4,7 +4,7 @@ namespace KeepersCompound.LGS.Database; public class ObjectHierarchy { - public class DarkObject + private class DarkObject { public int objectId; public int parentId; @@ -17,7 +17,7 @@ public class ObjectHierarchy properties = new Dictionary(); } - public T GetProperty(string propName) where T : Property + public T? GetProperty(string propName) where T : Property { if (properties.TryGetValue(propName, out var prop)) { @@ -102,7 +102,7 @@ public class ObjectHierarchy } // TODO: Work out if there's some nice way to automatically decide if we inherit - public T GetProperty(int objectId, string propName, bool inherit = true) where T : Property + public T? GetProperty(int objectId, string propName, bool inherit = true) where T : Property { if (!_objects.ContainsKey(objectId)) {