SEToolbox.Models.ExplorerModel.RenumberToolbar C# (CSharp) Method

RenumberToolbar() private method

private RenumberToolbar ( MyObjectBuilder_Toolbar toolbar, Int64>.Dictionary &idReplacementTable ) : void
toolbar MyObjectBuilder_Toolbar
idReplacementTable Int64>.Dictionary
return void
        private void RenumberToolbar(MyObjectBuilder_Toolbar toolbar, ref Dictionary<Int64, Int64> idReplacementTable)
        {
            if (toolbar == null)
                return;
            foreach (var item in toolbar.Slots)
            {
                var terminalGroup = item.Data as MyObjectBuilder_ToolbarItemTerminalGroup;
                if (terminalGroup != null)
                {
                    // GridEntityId does not require remapping. accoring to IL on ToolbarItemTerminalGroup.
                    //terminalGroup.GridEntityId = MergeId(terminalGroup.GridEntityId, ref idReplacementTable);
                    terminalGroup.BlockEntityId = MergeId(terminalGroup.BlockEntityId, ref idReplacementTable);
                }
                var terminalBlock = item.Data as MyObjectBuilder_ToolbarItemTerminalBlock;
                if (terminalBlock != null)
                {
                    terminalBlock.BlockEntityId = MergeId(terminalBlock.BlockEntityId, ref idReplacementTable);
                }
            }
        }