SolutionContainer refactors (#2954)

* removes unused method

* Code uncluttering (Also removed the netcode, color code, and visuals, need to rewrite)

* SolutionContainerVisualState

* Removes caching of SolutionContainer Color

* ChemicalsAdded() and ChemicalsRemoved() for updating appearance and handling reaction checks

* SolutionContainerComponentState

* Netcode

* ChemMasterComponent no longer creates a SolutionContainerComponent with new(), uses a Solution instead

* Enable nullable in SolutionContainer implementations

* Some review fixes

* uses IReadOnlyLists in ChemMaster

* Comments

* review fixes 3

* ReagentUnit documentation

* Review fixes

* spelling fix

* spelling 2

* typo

Co-authored-by: py01 <pyronetics01@gmail.com>
This commit is contained in:
py01
2021-01-10 02:41:55 -06:00
committed by GitHub
parent 0b7f286cf3
commit 7bf80fd4b8
14 changed files with 260 additions and 362 deletions

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.Chemistry;
@@ -30,20 +30,19 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ChemMaster
/// <summary>
/// A list of the reagents and their amounts within the beaker/reagent container, if applicable.
/// </summary>
public readonly List<Solution.ReagentQuantity> ContainerReagents;
public readonly IReadOnlyList<Solution.ReagentQuantity> ContainerReagents;
/// <summary>
/// A list of the reagents and their amounts within the buffer, if applicable.
/// </summary>
public readonly List<Solution.ReagentQuantity> BufferReagents;
public readonly IReadOnlyList<Solution.ReagentQuantity> BufferReagents;
public readonly string DispenserName;
public readonly bool BufferModeTransfer;
public readonly ReagentUnit BufferCurrentVolume;
public readonly ReagentUnit BufferMaxVolume;
public ChemMasterBoundUserInterfaceState(bool hasPower, bool hasBeaker, ReagentUnit beakerCurrentVolume, ReagentUnit beakerMaxVolume, string containerName,
string dispenserName, List<Solution.ReagentQuantity> containerReagents, List<Solution.ReagentQuantity> bufferReagents, bool bufferModeTransfer, ReagentUnit bufferCurrentVolume, ReagentUnit bufferMaxVolume)
string dispenserName, IReadOnlyList<Solution.ReagentQuantity> containerReagents, IReadOnlyList<Solution.ReagentQuantity> bufferReagents, bool bufferModeTransfer, ReagentUnit bufferCurrentVolume)
{
HasPower = hasPower;
HasBeaker = hasBeaker;
@@ -55,7 +54,6 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ChemMaster
BufferReagents = bufferReagents;
BufferModeTransfer = bufferModeTransfer;
BufferCurrentVolume = bufferCurrentVolume;
BufferMaxVolume = bufferMaxVolume;
}
}