48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
|
|
public class CommandSkillManager
|
|
{
|
|
/// <summary>
|
|
/// 指挥官可以携带的技能数量
|
|
/// </summary>
|
|
public static readonly int COMMAND_SKILL_COUNT = 3;
|
|
/// <summary>
|
|
/// 指挥官技能无效id
|
|
/// </summary>
|
|
public static readonly int NONE_ID = 0;
|
|
|
|
private readonly List<int> _commandSkillIDs = new() { NONE_ID, NONE_ID, NONE_ID };
|
|
|
|
public List<int> CommandSkillIDs => _commandSkillIDs;
|
|
|
|
public CommandSkillManager(int id0 = 0, int id1 = 0, int id2 = 0)
|
|
{
|
|
if(IsIdValid(id0))
|
|
_commandSkillIDs[0] = id0;
|
|
|
|
if (IsIdValid(id0))
|
|
_commandSkillIDs[1] = id1;
|
|
|
|
if (IsIdValid(id0))
|
|
_commandSkillIDs[2] = id2;
|
|
}
|
|
|
|
public int GetCommandSkillID(int idx)
|
|
{
|
|
return _commandSkillIDs[idx];
|
|
}
|
|
|
|
public void SetSkillID(int id, int idx)
|
|
{
|
|
_commandSkillIDs[idx] = id;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 指挥官技能id是否有效
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool IsIdValid(int skillId)
|
|
{
|
|
return skillId > NONE_ID;
|
|
}
|
|
} |