protected void Add(long duration, AgentItem src, AgentItem seedSrc, long time, bool atFirst, bool isExtension) { var toAdd = new BuffStackItem(time, duration, src, seedSrc, isExtension); // Find empty slot if (!IsFull) { if (atFirst) { BuffStack.Insert(0, toAdd); } else { _logic.Add(Log, BuffStack, toAdd); } } // Replace lowest value else { bool found = _logic.StackEffect(Log, toAdd, BuffStack, WasteSimulationResult); if (!found) { OverstackSimulationResult.Add(new BuffSimulationItemOverstack(src, duration, time)); } } }
public override void Add(long duration, AgentItem src, long start, uint stackID, bool addedActive, uint overstackDuration) { var toAdd = new BuffStackItem(start, duration, src); // Find empty slot if (!IsFull) { _logic.Add(Log, BuffStack, toAdd); } // Replace lowest value else { if (!_logic.FindLowestValue(Log, toAdd, BuffStack, WasteSimulationResult)) { OverstackSimulationResult.Add(new BuffSimulationItemOverstack(src, duration, start)); } } }
public override void Add(long duration, AgentItem src, long start, uint id, bool addedActive, uint overstackDuration) { var toAdd = new BuffStackItem(start, duration, src, ++ID); // Find empty slot if (BuffStack.Count < Capacity) { BuffStack.Add(toAdd); _logic.Sort(Log, BuffStack); } // Replace lowest value else { bool found = _logic.StackEffect(Log, toAdd, BuffStack, WasteSimulationResult); if (!found) { OverstackSimulationResult.Add(new BuffSimulationItemOverstack(src, duration, start)); } } }