< Summary

Information
Class: Gravitas.Constraints.RagdollLinkDefinition2D
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/2D/RagdollLinkDefinition2D.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 43
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/2D/RagdollLinkDefinition2D.cs

#LineLine coverage
 1//=======================================================================
 2// RagdollLinkDefinition2D.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2026-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using Gravitas.Colliders;
 9
 10namespace Gravitas.Constraints;
 11
 12/// <summary>
 13/// Authored link entry for a deterministic pure 2D ragdoll articulation.
 14/// </summary>
 15public readonly struct RagdollLinkDefinition2D
 16{
 17    /// <summary>
 18    /// Creates a pure 2D ragdoll link definition.
 19    /// </summary>
 20    public RagdollLinkDefinition2D(int linkId, SolidBody2D body)
 21    {
 6522        SwiftThrowHelper.ThrowIfNull(body, nameof(body));
 23
 6424        LinkId = linkId;
 6425        Body = body;
 6426        Collider = body.Collider;
 6427    }
 28
 29    /// <summary>
 30    /// Gets the stable authored link ID.
 31    /// </summary>
 32    public int LinkId { get; }
 33
 34    /// <summary>
 35    /// Gets the body represented by this ragdoll link.
 36    /// </summary>
 37    public SolidBody2D Body { get; }
 38
 39    /// <summary>
 40    /// Gets the collider represented by this ragdoll link.
 41    /// </summary>
 42    public LSCollider2D Collider { get; }
 43}