2021-11-01 15:49:00 +00:00
|
|
|
|
using QSB.ItemSync.WorldObjects.Items;
|
2021-02-25 14:53:34 +00:00
|
|
|
|
using QSB.WorldSync;
|
2021-02-23 14:42:18 +00:00
|
|
|
|
|
2021-11-01 15:49:00 +00:00
|
|
|
|
namespace QSB.ItemSync.WorldObjects.Sockets
|
2021-02-23 14:42:18 +00:00
|
|
|
|
{
|
2021-02-24 10:45:25 +00:00
|
|
|
|
internal class QSBOWItemSocket<T> : WorldObject<T>, IQSBOWItemSocket
|
2021-02-26 22:24:49 +00:00
|
|
|
|
where T : OWItemSocket
|
2021-02-23 14:42:18 +00:00
|
|
|
|
{
|
2021-02-25 14:53:34 +00:00
|
|
|
|
public virtual bool AcceptsItem(IQSBOWItem item)
|
|
|
|
|
{
|
|
|
|
|
var itemType = item.GetItemType();
|
2021-11-01 15:49:00 +00:00
|
|
|
|
var acceptableType = AttachedObject._acceptableType;
|
2021-02-25 14:53:34 +00:00
|
|
|
|
return (itemType & acceptableType) == itemType;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-26 20:56:57 +00:00
|
|
|
|
public virtual bool IsSocketOccupied()
|
|
|
|
|
=> AttachedObject.IsSocketOccupied();
|
|
|
|
|
|
2021-02-25 14:53:34 +00:00
|
|
|
|
public virtual bool PlaceIntoSocket(IQSBOWItem item)
|
2021-02-26 22:24:49 +00:00
|
|
|
|
=> AttachedObject.PlaceIntoSocket((OWItem)(item as IWorldObject).ReturnObject());
|
2021-02-25 21:24:10 +00:00
|
|
|
|
|
|
|
|
|
public virtual IQSBOWItem RemoveFromSocket()
|
2021-11-01 19:51:53 +00:00
|
|
|
|
=> (IQSBOWItem)QSBWorldSync.GetWorldFromUnity(AttachedObject.RemoveFromSocket());
|
2021-02-23 14:42:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|