From 5a354e4bee833504ff3a7f8fc58c6a81a512243d Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Tue, 4 Jun 2024 05:55:46 -0400 Subject: [PATCH] Base prop info That only has the parent path and rename --- NewHorizons/Builder/Props/PropBuildManager.cs | 6 ++--- .../External/Modules/GeneralPropInfo.cs | 26 +++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/NewHorizons/Builder/Props/PropBuildManager.cs b/NewHorizons/Builder/Props/PropBuildManager.cs index 113ecf10..0462548f 100644 --- a/NewHorizons/Builder/Props/PropBuildManager.cs +++ b/NewHorizons/Builder/Props/PropBuildManager.cs @@ -24,7 +24,7 @@ namespace NewHorizons.Builder.Props // If a prop has set its parentPath and the parent cannot be found, add it to the next pass and try again later var nextPass = new List(); - void MakeGeneralProp(GameObject go, T prop, Action builder) where T : GeneralPointPropInfo + void MakeGeneralProp(GameObject go, T prop, Action builder) where T : BasePropInfo { try { @@ -43,7 +43,7 @@ namespace NewHorizons.Builder.Props } } - void MakeGeneralProps(GameObject go, IEnumerable props, Action builder) where T : GeneralPointPropInfo + void MakeGeneralProps(GameObject go, IEnumerable props, Action builder) where T : BasePropInfo { if (props != null) { @@ -167,7 +167,7 @@ namespace NewHorizons.Builder.Props } } - private static bool DoesParentExist(GameObject go, GeneralPointPropInfo prop) + private static bool DoesParentExist(GameObject go, BasePropInfo prop) { if (string.IsNullOrEmpty(prop.parentPath)) { diff --git a/NewHorizons/External/Modules/GeneralPropInfo.cs b/NewHorizons/External/Modules/GeneralPropInfo.cs index fc855f9a..ebe39ac1 100644 --- a/NewHorizons/External/Modules/GeneralPropInfo.cs +++ b/NewHorizons/External/Modules/GeneralPropInfo.cs @@ -5,27 +5,31 @@ using Newtonsoft.Json; namespace NewHorizons.External.Modules { [JsonObject] - public abstract class GeneralPointPropInfo + public abstract class BasePropInfo + { + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// An optional rename of this object + /// + public string rename; + } + + [JsonObject] + public abstract class GeneralPointPropInfo : BasePropInfo { /// /// Position of the object /// public MVector3 position; - /// - /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). - /// - public string parentPath; - /// /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. /// public bool isRelativeToParent; - - /// - /// An optional rename of this object - /// - public string rename; } [JsonObject]