public ResolvedFormID Resolve(LoadOrder order, SSEPlugin parent) { var master = parent.GetMasterName((int)MasterIndex); var masterIndex = (UInt32)order.plugins.FindIndex(plugin => string.Equals(master, plugin, StringComparison.OrdinalIgnoreCase)); return(new ResolvedFormID(RecordID, masterIndex)); }
/// <summary> /// Use the Load Order to find the canonical FormID /// </summary> /// <param name="order"></param> /// <param name="plugin"></param> /// <returns></returns> public UInt32 ResolveFormID(LoadOrder order, SSEPlugin plugin) { // If the "master index" is not in the "master range", then this // is an "original" record if (MasterIndex >= plugin.pluginRecord.mast.Count) { return(id); } var masterPluginName = plugin.pluginRecord.mast[MasterIndex].content; sbyte masterIndex = (sbyte)order .plugins .FindIndex(pluginName => String.Equals(pluginName, masterPluginName, StringComparison.OrdinalIgnoreCase)); return((id & 0x00FFFFFF) | (UInt32)(masterIndex << (8 * 3))); }