add fuel indicator to ame fuel jar, minor refactor (#14590)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-03-12 12:39:10 +00:00
committed by GitHub
parent e93d5113ad
commit bf105968e9
4 changed files with 48 additions and 35 deletions

View File

@@ -1,37 +1,18 @@
namespace Content.Server.AME.Components
namespace Content.Server.AME.Components;
// TODO: network and put in shared
[RegisterComponent]
public sealed class AMEFuelContainerComponent : Component
{
[RegisterComponent]
public sealed class AMEFuelContainerComponent : Component
{
private int _fuelAmount;
private int _maxFuelAmount;
/// <summary>
/// The amount of fuel in the jar.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("fuelAmount")]
public int FuelAmount = 1000;
/// <summary>
/// The amount of fuel in the jar.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public int FuelAmount
{
get => _fuelAmount;
set => _fuelAmount = value;
}
/// <summary>
/// The maximum fuel capacity of the jar.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public int MaxFuelAmount
{
get => _maxFuelAmount;
set => _maxFuelAmount = value;
}
protected override void Initialize()
{
base.Initialize();
_maxFuelAmount = 1000;
_fuelAmount = 1000;
}
}
/// <summary>
/// The maximum fuel capacity of the jar.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("fuelCapacity")]
public int FuelCapacity = 1000;
}