From 503c0b85cc95d4423f521bc0727af64b7f487820 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 26 Jan 2022 00:55:47 -0800 Subject: [PATCH 1/2] 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() { } From 604249e39c4dd201da28be14d9e96f653868065e Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 26 Jan 2022 05:42:06 -0800 Subject: [PATCH 2/2] make this work with line numbers --- Directory.Build.props | 8 ++++++++ QSB/QSB.csproj | 7 ------- QSBTests/QSBTests.csproj | 6 ------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8c058ff8..a1d4105c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -28,4 +28,12 @@ + + true + portable + + + portable + + \ No newline at end of file diff --git a/QSB/QSB.csproj b/QSB/QSB.csproj index 2d9d08d9..8e37b9ef 100644 --- a/QSB/QSB.csproj +++ b/QSB/QSB.csproj @@ -7,13 +7,6 @@ {1F00090A-C697-4C55-B401-192F3CFB9DC2} $(OwmlDir)\Mods\QSB - - full - true - - - pdbonly - diff --git a/QSBTests/QSBTests.csproj b/QSBTests/QSBTests.csproj index a5de7792..26a3c263 100644 --- a/QSBTests/QSBTests.csproj +++ b/QSBTests/QSBTests.csproj @@ -10,12 +10,6 @@ UnitTest dotnet test QSBTests.dll - - full - - - pdbonly -