move hot plate item placement stuff into its own system (#18923)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
31
Content.Shared/Placeable/ItemPlacerComponent.cs
Normal file
31
Content.Shared/Placeable/ItemPlacerComponent.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Placeable;
|
||||
|
||||
/// <summary>
|
||||
/// Detects items placed on it that match a whitelist.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(ItemPlacerSystem))]
|
||||
public sealed partial class ItemPlacerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The entities that are currently on top of the placer.
|
||||
/// Guaranteed to have less than <see cref="MaxEntities"/> enitites if it is set.
|
||||
/// <summary>
|
||||
[DataField("placedEntities"), AutoNetworkedField]
|
||||
public HashSet<EntityUid> PlacedEntities = new();
|
||||
|
||||
/// <summary>
|
||||
/// Whitelist for entities that can be placed.
|
||||
/// </summary>
|
||||
[DataField("whitelist"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
/// <summary>
|
||||
/// The max amount of entities that can be placed at the same time.
|
||||
/// If 0, there is no limit.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("maxEntities"), AutoNetworkedField]
|
||||
public uint MaxEntities = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user