新增1.0和2.0两种协议车型车型

This commit is contained in:
ykkokluo
2026-07-17 13:36:01 +08:00
parent a0dc1e6cd0
commit a28bc68e23
62 changed files with 12638 additions and 203 deletions
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
namespace StandardScene.Fass2Simulator
{
public sealed class Fass2SimNodeProfile
{
public int ActionDelayMs { get; set; }
}
public sealed class Fass2SimNodeProfileStore
{
private readonly Dictionary<ushort, Fass2SimNodeProfile> _profiles = new Dictionary<ushort, Fass2SimNodeProfile>();
public void Load(IDictionary<string, Fass2SimNodeProfile> nodes)
{
_profiles.Clear();
if (nodes == null)
{
return;
}
foreach (var pair in nodes)
{
if (!ushort.TryParse(pair.Key, out var nodeId))
{
continue;
}
_profiles[nodeId] = pair.Value ?? new Fass2SimNodeProfile();
}
}
public int ResolveActionDelayMs(ushort nodeId, int fallbackMs)
{
if (_profiles.TryGetValue(nodeId, out var profile) && profile.ActionDelayMs > 0)
{
return profile.ActionDelayMs;
}
return fallbackMs;
}
}
}