< Summary

Information
Class: Lattice.ECS.Session.SessionRuntimeOptions
Assembly: Lattice
File(s): /home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Session/SessionRuntimeOptions.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 55
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
get_Default()100%11100%
.ctor(...)100%11100%
get_DeltaTime()100%11100%
get_LocalPlayerId()100%11100%
WithDeltaTime(...)100%11100%
WithLocalPlayerId(...)100%11100%

File(s)

/home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Session/SessionRuntimeOptions.cs

#LineLine coverage
 1using System;
 2using System.Runtime.CompilerServices;
 3using Lattice.Math;
 4
 5namespace Lattice.ECS.Session
 6{
 7    /// <summary>
 8    /// Session 运行时配置。
 9    /// 该对象只承载当前已经稳定公开的基础参数,不提前暴露历史窗口和采样策略等内部实现细节。
 10    /// </summary>
 11    public sealed class SessionRuntimeOptions
 12    {
 13        /// <summary>
 14        /// 默认运行配置。
 15        /// </summary>
 3316        public static SessionRuntimeOptions Default { get; } = new(FP.One, 0);
 17
 11518        public SessionRuntimeOptions(FP deltaTime, int localPlayerId = 0)
 19        {
 11520            DeltaTime = deltaTime;
 11521            LocalPlayerId = localPlayerId;
 11522        }
 23
 24        /// <summary>
 25        /// 固定时间步长。
 26        /// </summary>
 27        public FP DeltaTime
 28        {
 15729            [MethodImpl(MethodImplOptions.AggressiveInlining)]
 15730            get;
 31        }
 32
 33        /// <summary>
 34        /// 本地玩家 ID。
 35        /// 主要用于本地输入读取和最小预测链路。
 36        /// </summary>
 16737        public int LocalPlayerId { get; }
 38
 39        /// <summary>
 40        /// 创建一个仅替换固定时间步长的新配置。
 41        /// </summary>
 42        public SessionRuntimeOptions WithDeltaTime(FP deltaTime)
 43        {
 1044            return new SessionRuntimeOptions(deltaTime, LocalPlayerId);
 45        }
 46
 47        /// <summary>
 48        /// 创建一个仅替换本地玩家 ID 的新配置。
 49        /// </summary>
 50        public SessionRuntimeOptions WithLocalPlayerId(int localPlayerId)
 51        {
 552            return new SessionRuntimeOptions(DeltaTime, localPlayerId);
 53        }
 54    }
 55}