< Summary

Information
Class: Lattice.ECS.Core.EntityInfo
Assembly: Lattice
File(s): /home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Core/EntityInfo.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 49
Line coverage: 0%
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
get_IsActive()100%210%
get_Version()100%210%

File(s)

/home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Core/EntityInfo.cs

#LineLine coverage
 1// Copyright (c) 2026 Sideline Authors. All rights reserved.
 2// Licensed under GPL-3.0.
 3
 4using System.Runtime.InteropServices;
 5using Lattice.Core;
 6
 7namespace Lattice.ECS.Core
 8{
 9    /// <summary>
 10    /// 实体信息 - FrameSync 风格
 11    ///
 12    /// 每个实体在 Frame 中对应一个 EntityInfo
 13    /// 包含实体引用和标志位
 14    /// </summary>
 15    [StructLayout(LayoutKind.Explicit, Size = 12)]
 16    public struct EntityInfo
 17    {
 18        public const int ActiveBit = int.MinValue;
 19        public const int VersionMask = int.MaxValue;
 20
 21        /// <summary>实体引用(8字节)</summary>
 22        [FieldOffset(0)]
 23        public EntityRef Ref;
 24
 25        /// <summary>实体标志(4字节)</summary>
 26        [FieldOffset(8)]
 27        public EntityFlags Flags;
 28
 29        /// <summary>是否活跃</summary>
 030        public bool IsActive => (Ref.Version & ActiveBit) != 0;
 31
 32        /// <summary>获取版本号(不含活跃标志)</summary>
 033        public int Version => Ref.Version & VersionMask;
 34    }
 35
 36    /// <summary>
 37    /// 实体标志
 38    /// </summary>
 39    public enum EntityFlags : int
 40    {
 41        None = 0,
 42        /// <summary>不可被裁剪</summary>
 43        NotCullable = 1 << 0,
 44        /// <summary>已销毁(待清理)</summary>
 45        Destroyed = 1 << 1,
 46        /// <summary>原型实体</summary>
 47        IsPrototype = 1 << 2,
 48    }
 49}

Methods/Properties

get_IsActive()
get_Version()