using System.Collections.Generic; using System.Linq; public partial class ActTimeFlowConfig : IConfigPostProcess { //<流程id,状态值,配置ID> public static Dictionary> stateToIDs = new Dictionary>(); public void OnConfigParseCompleted() { if (!stateToIDs.ContainsKey(FlowID)) { stateToIDs[FlowID] = new Dictionary(); } stateToIDs[FlowID][StateValue] = ID; } public static bool TryGetFlowIDInfo(int flowID, out Dictionary 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); } }