And not a single "ToList()" went home to their family that day.....
This commit is contained in:
@@ -74,7 +74,7 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RefreshContentsDisplay(List<Solution.ReagentQuantity> reagents, List<EntityUid> solids)
|
private void RefreshContentsDisplay(IReadOnlyList<Solution.ReagentQuantity> reagents, List<EntityUid> solids)
|
||||||
{
|
{
|
||||||
_menu.IngredientsList.Clear();
|
_menu.IngredientsList.Clear();
|
||||||
foreach (var item in reagents)
|
foreach (var item in reagents)
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
_solidsVisualList.Add(item.Uid);
|
_solidsVisualList.Add(item.Uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
_userInterface.SetState(new MicrowaveUpdateUserInterfaceState(_solution.Solution.Contents.ToList(), _solidsVisualList));
|
_userInterface.SetState(new MicrowaveUpdateUserInterfaceState(_solution.Solution.Contents, _solidsVisualList));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||||
@@ -310,8 +310,9 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
|
|
||||||
private void VaporizeSolids()
|
private void VaporizeSolids()
|
||||||
{
|
{
|
||||||
foreach (var item in _storage.ContainedEntities.ToList())
|
for(var i = _storage.ContainedEntities.Count-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
|
var item = _storage.ContainedEntities.ElementAt(i);
|
||||||
_storage.Remove(item);
|
_storage.Remove(item);
|
||||||
item.Delete();
|
item.Delete();
|
||||||
}
|
}
|
||||||
@@ -321,9 +322,9 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
private void EjectSolids()
|
private void EjectSolids()
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (var item in _storage.ContainedEntities.ToList())
|
for(var i = _storage.ContainedEntities.Count-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
_storage.Remove(item);
|
_storage.Remove(_storage.ContainedEntities.ElementAt(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
_solids.Clear();
|
_solids.Clear();
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ namespace Content.Shared.Kitchen
|
|||||||
[NetSerializable, Serializable]
|
[NetSerializable, Serializable]
|
||||||
public class MicrowaveUpdateUserInterfaceState : BoundUserInterfaceState
|
public class MicrowaveUpdateUserInterfaceState : BoundUserInterfaceState
|
||||||
{
|
{
|
||||||
public readonly List<Solution.ReagentQuantity> ReagentsReagents;
|
public readonly IReadOnlyList<Solution.ReagentQuantity> ReagentsReagents;
|
||||||
public readonly List<EntityUid> ContainedSolids;
|
public readonly List<EntityUid> ContainedSolids;
|
||||||
public MicrowaveUpdateUserInterfaceState(List<Solution.ReagentQuantity> reagents, List<EntityUid> solids)
|
public MicrowaveUpdateUserInterfaceState(IReadOnlyList<Solution.ReagentQuantity> reagents, List<EntityUid> solids)
|
||||||
{
|
{
|
||||||
ReagentsReagents = reagents;
|
ReagentsReagents = reagents;
|
||||||
ContainedSolids = solids;
|
ContainedSolids = solids;
|
||||||
|
|||||||
Reference in New Issue
Block a user