public EffectBandSlot GetOrCreateSlot(EffectBand band) { // first check preferrable slot depending on type if (_effectSlot.ContainsKey(band.Info.EffectId)) { var slot = _effectSlot[band.Info.EffectId]; if (slot.CanBeUsed(band)) { return(slot); } } // find any slot that can be used foreach (var slot in Slots) { if (slot.CanBeUsed(band)) { return(slot); } } // create a new slot if required var newSlot = new EffectBandSlot(); Slots.Add(newSlot); return(newSlot); }
public void CopySlots(EffectBandSizingInfo sizingInfo) { foreach (var slot in sizingInfo.Slots) { var copy = new EffectBandSlot(); copy.Y = slot.Y; copy.Height = slot.Height; copy.UniqueEffectId = slot.UniqueEffectId; Slots.Add(copy); foreach (var band in slot.Bands) { _effectSlot[band.Info.EffectId] = copy; } } }