Gas Canisters and Ports (#2151)

* CanisterComponent start

* GasCanisterPort

* canister

* GasCanister yaml

* More Gas Canisters

* Canister & port fixes

* Placeholder canister and port sprites

* GasMixture serialization

* Component ignores

* Fix duplicate component ignore

Co-authored-by: py01 <pyronetics01@gmail.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
py01
2020-10-10 05:37:52 -06:00
committed by GitHub
parent ccfc035a2a
commit 5aa866548b
6 changed files with 223 additions and 5 deletions

View File

@@ -60,22 +60,23 @@ namespace Content.Server.GameObjects.Components.NodeContainer.Nodes
public GasMixture LocalAir { get; set; }
[ViewVariables]
public float Volume { get; private set; }
public float Volume => LocalAir.Volume;
private AppearanceComponent _appearance;
private const float DefaultVolume = 1;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _pipeDirection, "pipeDirection", PipeDirection.None);
serializer.DataField(this, x => Volume, "volume", 10);
serializer.DataField(this, x => LocalAir, "gasMixture", new GasMixture(DefaultVolume));
serializer.DataField(ref _conduitLayer, "conduitLayer", ConduitLayer.Two);
}
public override void Initialize(IEntity owner)
{
base.Initialize(owner);
LocalAir = new GasMixture(Volume);
Owner.TryGetComponent(out _appearance);
UpdateAppearance();
}