From 503c0b85cc95d4423f521bc0727af64b7f487820 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 26 Jan 2022 00:55:47 -0800 Subject: [PATCH] rename IWorldObject.ReturnObject to AttachedObject --- QSB/ItemSync/WorldObjects/Sockets/QSBOWItemDoubleSocket.cs | 2 +- QSB/ItemSync/WorldObjects/Sockets/QSBOWItemSocket.cs | 2 +- QSB/Utility/DebugGUI.cs | 6 +++--- QSB/WorldSync/IWorldObject.cs | 2 +- QSB/WorldSync/WorldObject.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemDoubleSocket.cs b/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemDoubleSocket.cs index f74850a6..80013e1a 100644 --- a/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemDoubleSocket.cs +++ b/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemDoubleSocket.cs @@ -17,7 +17,7 @@ namespace QSB.ItemSync.WorldObjects.Sockets => AttachedObject.IsSocketOccupied(); public virtual bool PlaceIntoSocket(IQSBOWItem item) - => AttachedObject.PlaceIntoSocket((OWItem)item.ReturnObject()); + => AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject); public virtual IQSBOWItem RemoveFromSocket() => AttachedObject.RemoveFromSocket().GetWorldObject(); diff --git a/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemSocket.cs b/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemSocket.cs index d9f1a52e..be3a12d5 100644 --- a/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemSocket.cs +++ b/QSB/ItemSync/WorldObjects/Sockets/QSBOWItemSocket.cs @@ -17,7 +17,7 @@ namespace QSB.ItemSync.WorldObjects.Sockets => AttachedObject.IsSocketOccupied(); public virtual bool PlaceIntoSocket(IQSBOWItem item) - => AttachedObject.PlaceIntoSocket((OWItem)item.ReturnObject()); + => AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject); public virtual IQSBOWItem RemoveFromSocket() => AttachedObject.RemoveFromSocket().GetWorldObject(); diff --git a/QSB/Utility/DebugGUI.cs b/QSB/Utility/DebugGUI.cs index b8ed780d..655f1835 100644 --- a/QSB/Utility/DebugGUI.cs +++ b/QSB/Utility/DebugGUI.cs @@ -258,14 +258,14 @@ namespace QSB.Utility foreach (var obj in QSBWorldSync.GetWorldObjects()) { - if (obj.ReturnObject() == null) + if (obj.AttachedObject == null) { return; } if (obj.ShouldDisplayDebug()) { - DrawLabel(obj.ReturnObject().transform, obj.ReturnLabel()); + DrawLabel(obj.AttachedObject.transform, obj.ReturnLabel()); } } } @@ -279,7 +279,7 @@ namespace QSB.Utility foreach (var obj in QSBWorldSync.GetWorldObjects()) { - if (obj.ReturnObject() == null) + if (obj.AttachedObject == null) { return; } diff --git a/QSB/WorldSync/IWorldObject.cs b/QSB/WorldSync/IWorldObject.cs index d0df0c65..acfbf1bb 100644 --- a/QSB/WorldSync/IWorldObject.cs +++ b/QSB/WorldSync/IWorldObject.cs @@ -6,9 +6,9 @@ namespace QSB.WorldSync { int ObjectId { get; } string Name { get; } + MonoBehaviour AttachedObject { get; } void OnRemoval(); - MonoBehaviour ReturnObject(); bool ShouldDisplayDebug(); string ReturnLabel(); void DisplayLines(); diff --git a/QSB/WorldSync/WorldObject.cs b/QSB/WorldSync/WorldObject.cs index 3c5bdbd6..b0dd734e 100644 --- a/QSB/WorldSync/WorldObject.cs +++ b/QSB/WorldSync/WorldObject.cs @@ -6,13 +6,13 @@ namespace QSB.WorldSync where T : MonoBehaviour { public int ObjectId { get; init; } + MonoBehaviour IWorldObject.AttachedObject => AttachedObject; public T AttachedObject { get; init; } public string Name => AttachedObject ? AttachedObject.name : ""; public override string ToString() => $"{ObjectId}:{GetType().Name} ({Name})"; public virtual void Init() { } public virtual void OnRemoval() { } - public MonoBehaviour ReturnObject() => AttachedObject; public virtual bool ShouldDisplayDebug() => QSBWorldSync.AllObjectsReady && AttachedObject && AttachedObject.gameObject.activeInHierarchy; public virtual string ReturnLabel() => ToString(); public virtual void DisplayLines() { }