first commit
This commit is contained in:
14
NitroxClient/GameLogic/Simulation/HandInteraction.cs
Normal file
14
NitroxClient/GameLogic/Simulation/HandInteraction.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace NitroxClient.GameLogic.Simulation
|
||||
{
|
||||
public class HandInteraction<T> : LockRequestContext where T : IHandTarget
|
||||
{
|
||||
public T Target { get; }
|
||||
public GUIHand GuiHand { get; }
|
||||
|
||||
public HandInteraction(T Target, GUIHand GuiHand)
|
||||
{
|
||||
this.Target = Target;
|
||||
this.GuiHand = GuiHand;
|
||||
}
|
||||
}
|
||||
}
|
27
NitroxClient/GameLogic/Simulation/LockRequest.cs
Normal file
27
NitroxClient/GameLogic/Simulation/LockRequest.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using NitroxModel.DataStructures;
|
||||
|
||||
namespace NitroxClient.GameLogic.Simulation
|
||||
{
|
||||
public class LockRequest<T> : LockRequestBase where T : LockRequestContext
|
||||
{
|
||||
public delegate void LockRequestCompleted(NitroxId id, bool lockAquired, T context);
|
||||
|
||||
private LockRequestCompleted onComplete;
|
||||
private T context { get; }
|
||||
|
||||
public LockRequest(NitroxId id, SimulationLockType lockType, LockRequestCompleted onComplete, T context) : base(id, lockType)
|
||||
{
|
||||
this.onComplete = onComplete;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public override void LockRequestComplete(NitroxId id, bool lockAquired)
|
||||
{
|
||||
if (onComplete != null)
|
||||
{
|
||||
onComplete(id, lockAquired, (T)context);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
18
NitroxClient/GameLogic/Simulation/LockRequestBase.cs
Normal file
18
NitroxClient/GameLogic/Simulation/LockRequestBase.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using NitroxModel.DataStructures;
|
||||
|
||||
namespace NitroxClient.GameLogic.Simulation
|
||||
{
|
||||
public abstract class LockRequestBase
|
||||
{
|
||||
public NitroxId Id { get; }
|
||||
public SimulationLockType LockType { get; }
|
||||
|
||||
public abstract void LockRequestComplete(NitroxId id, bool lockAquired);
|
||||
|
||||
public LockRequestBase(NitroxId Id, SimulationLockType LockType) : base()
|
||||
{
|
||||
this.Id = Id;
|
||||
this.LockType = LockType;
|
||||
}
|
||||
}
|
||||
}
|
7
NitroxClient/GameLogic/Simulation/LockRequestContext.cs
Normal file
7
NitroxClient/GameLogic/Simulation/LockRequestContext.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace NitroxClient.GameLogic.Simulation
|
||||
{
|
||||
// Additional metadata that is necessary to process a lock request
|
||||
public interface LockRequestContext
|
||||
{
|
||||
}
|
||||
}
|
16
NitroxClient/GameLogic/Simulation/PropulsionGrab.cs
Normal file
16
NitroxClient/GameLogic/Simulation/PropulsionGrab.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.Simulation
|
||||
{
|
||||
public class PropulsionGrab : LockRequestContext
|
||||
{
|
||||
public PropulsionCannon Cannon { get; }
|
||||
public GameObject GrabbedObject { get; }
|
||||
|
||||
public PropulsionGrab(PropulsionCannon Cannon, GameObject GrabbedObject)
|
||||
{
|
||||
this.Cannon = Cannon;
|
||||
this.GrabbedObject = GrabbedObject;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user