items: prepare for remote call stuff

This commit is contained in:
JohnCorby 2022-03-23 14:27:20 -07:00
parent c3168aa694
commit e44b6aebdf
3 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,7 @@
using HarmonyLib;
using OWML.Common;
using QSB.ItemSync.Messages;
using QSB.ItemSync.WorldObjects;
using QSB.ItemSync.WorldObjects.Items;
using QSB.ItemSync.WorldObjects.Sockets;
using QSB.Messaging;

View File

@ -3,7 +3,6 @@ using QSB.ItemSync.WorldObjects.Sockets;
using QSB.Patches;
using QSB.Player;
using QSB.SectorSync.WorldObjects;
using QSB.Utility;
using QSB.WorldSync;
using System.Threading;
using UnityEngine;
@ -75,8 +74,7 @@ internal class QSBItem<T> : WorldObject<T>, IQSBItem
// todo SendInitialState
}
public ItemType GetItemType()
=> QSBPatch.RemoteCall(AttachedObject.GetItemType);
public ItemType GetItemType() => AttachedObject.GetItemType();
public void PickUpItem(Transform holdTransform)
=> QSBPatch.RemoteCall(() => AttachedObject.PickUpItem(holdTransform));

View File

@ -1,4 +1,5 @@
using QSB.ItemSync.WorldObjects.Items;
using QSB.Patches;
using QSB.WorldSync;
namespace QSB.ItemSync.WorldObjects.Sockets;
@ -10,12 +11,11 @@ internal class QSBItemSocket : WorldObject<OWItemSocket>
// todo SendInitialState
}
public bool IsSocketOccupied()
=> AttachedObject.IsSocketOccupied();
public bool IsSocketOccupied() => AttachedObject.IsSocketOccupied();
public void PlaceIntoSocket(IQSBItem item)
=> AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject);
=> QSBPatch.RemoteCall(() => AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject));
public void RemoveFromSocket()
=> AttachedObject.RemoveFromSocket();
=> QSBPatch.RemoteCall(AttachedObject.RemoveFromSocket);
}