* Add nullable to some Content.Shared files. * Use [NotNullWhen(true)] * Undo adding now redundant !'s * Forgot one * Add a ton more nullable * You can guess * Fix some issues * It actually compiles now * Auto stash before merge of "null2" and "origin/master" * I lied * enable annotations -> enable * Revert ActionBlockerSystem.cs to original * Fix ActionBlockerSystem.cs * More nullable * Undo some added exclamation marks * Fix issues * Update Content.Shared/Maps/ContentTileDefinition.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Resolve some issues * Remove unused method * Fix more issues * Fix more issues * Fix more issues * Fix more issues * Fix issue, rollback SharedGhostComponent.cs * Update submodule * Fix issue, invert some if-statements to reduce nesting * Revert RobustToolbox * FIx things broken by merge * Some fixes - Replaced with string.Empty - Remove some exclamation marks - Revert file * Some fixes * Trivial #nullable enable * Fix null ables Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
101 lines
3.0 KiB
C#
101 lines
3.0 KiB
C#
#nullable enable
|
|
using System;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.GameObjects.Components.Cargo
|
|
{
|
|
public class SharedCargoConsoleComponent : Component
|
|
{
|
|
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
|
|
|
|
public sealed override string Name => "CargoConsole";
|
|
|
|
/// <summary>
|
|
/// Sends away or requests shuttle
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public class CargoConsoleShuttleMessage : BoundUserInterfaceMessage
|
|
{
|
|
public CargoConsoleShuttleMessage()
|
|
{
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Add order to database.
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public class CargoConsoleAddOrderMessage : BoundUserInterfaceMessage
|
|
{
|
|
public string Requester;
|
|
public string Reason;
|
|
public string ProductId;
|
|
public int Amount;
|
|
|
|
public CargoConsoleAddOrderMessage(string requester, string reason, string productId, int amount)
|
|
{
|
|
Requester = requester;
|
|
Reason = reason;
|
|
ProductId = productId;
|
|
Amount = amount;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Remove order from database.
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public class CargoConsoleRemoveOrderMessage : BoundUserInterfaceMessage
|
|
{
|
|
public int OrderNumber;
|
|
|
|
public CargoConsoleRemoveOrderMessage(int orderNumber)
|
|
{
|
|
OrderNumber = orderNumber;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Set order in database as approved.
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public class CargoConsoleApproveOrderMessage : BoundUserInterfaceMessage
|
|
{
|
|
public int OrderNumber;
|
|
|
|
public CargoConsoleApproveOrderMessage(int orderNumber)
|
|
{
|
|
OrderNumber = orderNumber;
|
|
}
|
|
}
|
|
|
|
[NetSerializable, Serializable]
|
|
public enum CargoConsoleUiKey
|
|
{
|
|
Key
|
|
}
|
|
}
|
|
|
|
[NetSerializable, Serializable]
|
|
public class CargoConsoleInterfaceState : BoundUserInterfaceState
|
|
{
|
|
public readonly bool RequestOnly;
|
|
public readonly int BankId;
|
|
public readonly string BankName;
|
|
public readonly int BankBalance;
|
|
public readonly (int CurrentCapacity, int MaxCapacity) ShuttleCapacity;
|
|
|
|
public CargoConsoleInterfaceState(bool requestOnly, int bankId, string bankName, int bankBalance, (int CurrentCapacity, int MaxCapacity) shuttleCapacity)
|
|
{
|
|
RequestOnly = requestOnly;
|
|
BankId = bankId;
|
|
BankName = bankName;
|
|
BankBalance = bankBalance;
|
|
ShuttleCapacity = shuttleCapacity;
|
|
}
|
|
}
|
|
}
|