Files
Nitrox/NitroxClient/Communication/Packets/Processors/ExosuitArmActionProcessor.cs
2025-07-06 00:23:46 +02:00

37 lines
1.4 KiB
C#

using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
using NitroxClient.MonoBehaviours;
using NitroxModel_Subnautica.DataStructures;
using NitroxModel_Subnautica.Packets;
using UnityEngine;
namespace NitroxClient.Communication.Packets.Processors;
public class ExosuitArmActionProcessor : ClientPacketProcessor<ExosuitArmActionPacket>
{
public override void Process(ExosuitArmActionPacket packet)
{
if (!NitroxEntity.TryGetObjectFrom(packet.ArmId, out GameObject gameObject))
{
Log.Error("Could not find exosuit arm");
return;
}
switch (packet.TechType)
{
case TechType.ExosuitClawArmModule:
ExosuitModuleEvent.UseClaw(gameObject.GetComponent<ExosuitClawArm>(), packet.ArmAction);
break;
case TechType.ExosuitDrillArmModule:
ExosuitModuleEvent.UseDrill(gameObject.GetComponent<ExosuitDrillArm>(), packet.ArmAction);
break;
case TechType.ExosuitGrapplingArmModule:
ExosuitModuleEvent.UseGrappling(gameObject.GetComponent<ExosuitGrapplingArm>(), packet.ArmAction, packet.OpVector?.ToUnity());
break;
default:
Log.Error($"Got an arm tech that is not handled: {packet.TechType} with action: {packet.ArmAction} for id {packet.ArmId}");
break;
}
}
}