FunGame-Core/Model/ActionQueue.cs
milimoe 290b9fe26b
抽象 ActionQueue,分离模式 (#134)
* 抽象 ActionQueue,方便继承扩展;RoundRecord 添加了记录发动技能的字典;特效添加 IsSubsidiary 属性

* 修改包名

* modify

---------

Co-authored-by: yeziuku <yezi@wrss.org>
2025-05-03 00:03:21 +08:00

31 lines
923 B
C#

using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Core.Model
{
/// <summary>
/// 行动顺序表管理器,对 <see cref="GamingQueue"/> 的封装
/// </summary>
public class ActionQueue : GamingQueue
{
private ActionQueue() { }
/// <summary>
/// 按房间类型创建行动顺序表
/// </summary>
/// <param name="type"></param>
/// <param name="characters"></param>
/// <param name="writer"></param>
/// <returns></returns>
public static GamingQueue NewGame(RoomType type, List<Character>? characters = null, Action<string>? writer = null)
{
characters ??= [];
return type switch
{
RoomType.Team => new TeamGamingQueue(writer),
_ => new MixGamingQueue(writer)
};
}
}
}