Files
tbd-station-14/Content.Shared/Materials/OreSilo/OreSiloComponent.cs
Nemanja f8ff7aee92 Local Material Silo (#36492)
* Material Silo

* fix board, fix copyright

* a bit of review.... for the vibe....

* a tiny bit of review

* 4 spaced

* sloths no good very tiny nitpick

* fix ui flickers

* oops

* slightly lower range

* Sloth Review

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
2025-04-19 09:43:17 +10:00

56 lines
1.5 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Materials.OreSilo;
/// <summary>
/// Provides additional materials to linked clients across long distances.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedOreSiloSystem))]
public sealed partial class OreSiloComponent : Component
{
/// <summary>
/// The <see cref="OreSiloClientComponent"/> that are connected to this silo.
/// </summary>
[DataField, AutoNetworkedField]
public HashSet<EntityUid> Clients = new();
/// <summary>
/// The maximum distance you can be to the silo and still receive transmission.
/// </summary>
/// <remarks>
/// Default value should be big enough to span a single large department.
/// </remarks>
[DataField, AutoNetworkedField]
public float Range = 20f;
}
[Serializable, NetSerializable]
public sealed class OreSiloBuiState : BoundUserInterfaceState
{
public readonly HashSet<(NetEntity, string, string)> Clients;
public OreSiloBuiState(HashSet<(NetEntity, string, string)> clients)
{
Clients = clients;
}
}
[Serializable, NetSerializable]
public sealed class ToggleOreSiloClientMessage : BoundUserInterfaceMessage
{
public readonly NetEntity Client;
public ToggleOreSiloClientMessage(NetEntity client)
{
Client = client;
}
}
[Serializable, NetSerializable]
public enum OreSiloUiKey : byte
{
Key
}