/// <summary> /// Updates the buildng's maximum level. /// </summary> /// <param name="maxLevel">New maximum level</param> private void UpdateMaxLevel(byte maxLevel) { // Don't do anything if events are disabled. if (!disableEvents) { // Update maximum level. BuildingsABLC.UpdateMaxLevel(targetID, maxLevel); // 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); } } }