mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-04 02:57:08 +02:00
* feex * Cleanup * Remove unneeded matrix * Fixes * Fix preprocessor * localanchor cleanup * Break this build so I remember to fix it later. * Fixes * Woops * Fixes * Fixup merge * Stuff * Update debug drawing * Also dis thanks fork * fren * More colors * Default drawing * Fixes * reviews
30 lines
878 B
C#
30 lines
878 B
C#
using System.Collections.Generic;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Physics;
|
|
using Robust.Shared.Physics.Dynamics.Joints;
|
|
|
|
namespace Robust.Server.Physics
|
|
{
|
|
public sealed class JointSystem : SharedJointSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<JointComponent, ComponentGetState>(GetCompState);
|
|
}
|
|
|
|
private void GetCompState(EntityUid uid, JointComponent component, ref ComponentGetState args)
|
|
{
|
|
var states = new Dictionary<string, JointState>(component.Joints.Count);
|
|
|
|
foreach (var (_, joint) in component.Joints)
|
|
{
|
|
states.Add(joint.ID, joint.GetState());
|
|
}
|
|
|
|
args.State = new JointComponent.JointComponentState(states);
|
|
}
|
|
}
|
|
}
|