- 组合式单位与数值基础重构:scripts/Models/UnitModel.cs, scripts/Models/UnitComponents.cs, scripts/Models/StudentModel.cs, scripts/Models/MentorModel.cs, scripts/Models/StaffModel.cs, scripts/Models/PropertyValue.cs, scripts/Models/StatusValue.cs - 任务与运行时状态骨架:scripts/Models/Task.cs, scripts/Models/TaskDefinitions.cs, scripts/Models/GameState.cs - 配置与规则定义骨架:scripts/Models/DefinitionSupport.cs, scripts/Models/DomainEnums.cs, scripts/Models/Modifiers.cs, scripts/Models/DisciplineDefinitions.cs, scripts/Models/SynergyDefinitions.cs, scripts/Models/ItemDefinitions.cs, scripts/Models/PaperDefinitions.cs, scripts/Models/RogueliteDefinitions.cs, scripts/Models/GameContentDatabase.cs, scripts/Models/CoreIds.cs - MVC/会话/系统/i18n/Mod 支撑:scripts/Core/GameSession.cs, scripts/Core/GameSystems.cs, scripts/Core/GameController.cs, scripts/Core/Mvc.cs, scripts/Core/LocalizationService.cs, scripts/Core/ContentRegistry.cs, scripts/Core/ModManifest.cs, scripts/Core/EventBus.cs - 主控流程衔接:scripts/GameManager.cs
85 lines
2.5 KiB
C#
85 lines
2.5 KiB
C#
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 sealed class RogueliteState
|
||
{
|
||
public List<string> AlumniCardIds { get; } = new();
|
||
public List<string> LegacyUnlockIds { get; } = new();
|
||
public int TitleRetentionLevel { get; set; }
|
||
}
|
||
|