GFramework/GFramework.Core.Tests/State/TestStateMachineSystemV5.cs
gewuyou ff553977e3 chore(license): 补齐 Apache-2.0 文件头治理
- 新增许可证文件头检查与修复脚本

- 补充维护者手动修复 PR 工作流和 CI 校验

- 更新贡献指南中的文件头说明

- 补齐仓库维护源码和配置文件的许可证声明
2026-05-03 19:39:49 +08:00

26 lines
867 B
C#

// Copyright (c) 2025-2026 GeWuYou
// SPDX-License-Identifier: Apache-2.0
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using GFramework.Core.Abstractions.State;
using GFramework.Core.State;
namespace GFramework.Core.Tests.State;
/// <summary>
/// 为 <see cref="StateMachineSystemTests" /> 提供可观察内部状态注册表的测试状态机实现。
/// </summary>
public class TestStateMachineSystemV5 : StateMachineSystem
{
/// <summary>
/// 获取状态机当前维护的状态实例映射,供测试断言注册结果使用。
/// </summary>
/// <returns>状态类型到状态实例的只读视图。</returns>
public IReadOnlyDictionary<Type, IState> GetStates()
{
return States as IReadOnlyDictionary<Type, IState> ?? new ReadOnlyDictionary<Type, IState>(States);
}
}