/// <summary> /// Updates the buildng's minimum level. /// </summary> /// <param name="minLevel">New minimum level</param> private void UpdateMinLevel(byte minLevel) { // Don't do anything if events are disabled. if (!disableEvents) { // Update minimum level. BuildingsABLC.UpdateMinLevel(targetID, minLevel); // Update the panel. BuildingChanged(); } }
/// <summary> /// Called by Move It when an object is pasted. /// Used here to copy any ABLC building settings to the copied buildings(s). /// </summary> /// <param name="targetInstanceID">Target instance (unused)</param> /// <param name="record">Custom data record (unused)</param> /// <param name="sourceMap">Mapping of new building instances to original building instances</param> public override void Paste(InstanceID targetInstanceID, object record, Dictionary <InstanceID, InstanceID> sourceMap) { // Iterate through each mapping entry in the dictionary. foreach (KeyValuePair <InstanceID, InstanceID> entry in sourceMap) { // Check if the original building has an ABLC custom level entry. ushort originalBuilding = entry.Key.Building; if (BuildingsABLC.levelRanges.ContainsKey(originalBuilding)) { // Original building has an ABLC level entry - apply those same settings to the new building. ushort newBuilding = entry.Value.Building; BuildingsABLC.UpdateMinLevel(newBuilding, BuildingsABLC.levelRanges[originalBuilding].minLevel); BuildingsABLC.UpdateMaxLevel(newBuilding, BuildingsABLC.levelRanges[originalBuilding].maxLevel); } } }