supervisor-simulator/scripts/Models/GameState.cs
wjsjwr 9c1593e717 已把 TaskSystem/SynergySystem/EconomySystem 按设计文档的“核心规则”落地成可运行逻辑,并把回合结算从 GameManager 下沉到系统与事件流上。
- 任务推进与结算:执行阶段按任务类型用属性权重计算进度、考虑角色/学科匹配、状态衰减与难度缩放,回合结束统一扣 Deadline、判定完成/失败并派发事件,同时记录署名贡献度 scripts/Core/GameSystems.cs
  - 经济结算:接收任务事件发奖惩,学术探索根据难度生成论文卡;回合结束统一扣工资并结息(经济学学科触发基础利率)scripts/Core/GameSystems.cs
  - 羁绊层数与效果:统计人群画像/职能分工堆叠,激活层级并聚合为全局 ModifierBundle 给数值解析器使用 scripts/Core/GameSystems.cs, scripts/Models/GameState.cs
  - 事件与数值解析支撑:新增领域事件与统一属性合成器,兼容羁绊/学科/特质/装备的叠加 scripts/Core/DomainEvents.cs, scripts/Core/StatResolver.cs
  - 回合结算入口调整:Review 阶段改由系统处理并发布回合结束事件 scripts/GameManager.cs
2026-01-01 00:07:16 +08:00

86 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.Generic;
namespace Models;
/// <summary>
/// 运行时全局状态GameState
/// 设计说明:
/// 1) 将“局内状态”集中在一个聚合对象中,便于存档与调试快照。
/// 2) 具体子状态按职责拆分:回合/经济/人员/任务/库存/羁绊。
/// 3) Controller/System 只依赖这份数据,不直接操作 View。
/// 注意事项:
/// - 这是运行时数据,不是配置数据;配置请看 *Definition 类。
/// - 禁止在这里引用 Godot Node保持纯数据。
/// 未来扩展:
/// - 可加入“存档版本号”和“迁移器”,支持版本升级。
/// - 可加入“局外 Roguelite 状态”,与局内共享接口。
/// </summary>
public sealed class GameState
{
public TurnState Turn { get; } = new();
public EconomyState Economy { get; } = new();
public RosterState Roster { get; } = new();
public TaskState Tasks { get; } = new();
public InventoryState Inventory { get; } = new();
public SynergyState Synergy { get; } = new();
public RogueliteState Roguelite { get; } = new();
}
public enum GamePhase
{
Planning,
Execution,
Review
}
public sealed class TurnState
{
public int CurrentTurn { get; set; } = 1;
public int MaxTurns { get; set; } = 30;
public GamePhase Phase { get; set; } = GamePhase.Planning;
}
public sealed class EconomyState
{
public int Money { get; set; } = 50000;
public int Reputation { get; set; }
public int ResearchPoints { get; set; }
public float InterestRate { get; set; } = 0.0f;
}
public sealed class RosterState
{
public MentorModel Mentor { get; set; } = new("Player");
public List<StudentModel> Students { get; } = new();
public List<StaffModel> Staffs { get; } = new();
}
public sealed class TaskState
{
public List<TaskModel> ActiveTasks { get; } = new();
public List<TaskModel> CompletedTasks { get; } = new();
public List<TaskModel> FailedTasks { get; } = new();
}
public sealed class InventoryState
{
public Dictionary<string, int> ItemCounts { get; } = new();
public Dictionary<PaperRank, int> PaperCounts { get; } = new();
}
public sealed class SynergyState
{
public Dictionary<string, int> ArchetypeStacks { get; } = new();
public Dictionary<string, int> RoleStacks { get; } = new();
public List<string> ActiveSynergyIds { get; } = new();
public ModifierBundle ActiveModifiers { get; } = new();
}
public sealed class RogueliteState
{
public List<string> AlumniCardIds { get; } = new();
public List<string> LegacyUnlockIds { get; } = new();
public int TitleRetentionLevel { get; set; }
}