少年修仙传客户端代码仓库
lcy
2025-05-08 1314c3b3c14cd520bbb8569b5f98d68933a22cd3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections.Generic;
using System.Linq;
 
public partial class ActTimeFlowConfig : IConfigPostProcess
{
    //<流程id,状态值,配置ID>
    public static Dictionary<int, Dictionary<int, int>> stateToIDs = new Dictionary<int, Dictionary<int, int>>();
 
    public void OnConfigParseCompleted()
    {
        if (!stateToIDs.ContainsKey(FlowID))
        {
            stateToIDs[FlowID] = new Dictionary<int, int>();
        }
        stateToIDs[FlowID][StateValue] = ID;
    }
 
    public static bool TryGetFlowIDInfo(int flowID, out Dictionary<int, int> info)
    {
        info = null;
        if (stateToIDs.IsNullOrEmpty())
            return false;
        return stateToIDs.TryGetValue(flowID, out info);
    }
 
    public static bool TryGetID(int flowID, int stateValue, out int id)
    {
        id = 0;
        return TryGetFlowIDInfo(flowID, out var info) && info.TryGetValue(stateValue, out id);
    }
 
}