2020-08-13 14:40:27 +02:00
|
|
|
using Content.Shared.Roles;
|
2020-01-23 17:31:47 +01:00
|
|
|
using Robust.Shared.Prototypes;
|
2019-03-17 15:52:27 +01:00
|
|
|
|
2023-04-08 16:52:52 -07:00
|
|
|
namespace Content.Server.Spawners.Components;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
public sealed class SpawnPointComponent : Component
|
2019-03-17 15:52:27 +01:00
|
|
|
{
|
2023-04-08 16:52:52 -07:00
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
2020-01-23 17:31:47 +01:00
|
|
|
|
2023-04-08 16:52:52 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("job_id")]
|
|
|
|
|
private string? _jobId;
|
2021-03-16 15:50:20 +01:00
|
|
|
|
2023-04-08 16:52:52 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("spawn_type")]
|
|
|
|
|
public SpawnPointType SpawnType { get; } = SpawnPointType.Unset;
|
2021-03-16 15:50:20 +01:00
|
|
|
|
2023-04-08 16:52:52 -07:00
|
|
|
public JobPrototype? Job => string.IsNullOrEmpty(_jobId) ? null : _prototypeManager.Index<JobPrototype>(_jobId);
|
|
|
|
|
}
|
2019-03-17 15:52:27 +01:00
|
|
|
|
2023-04-08 16:52:52 -07:00
|
|
|
public enum SpawnPointType
|
|
|
|
|
{
|
|
|
|
|
Unset = 0,
|
|
|
|
|
LateJoin,
|
|
|
|
|
Job,
|
|
|
|
|
Observer,
|
2019-03-17 15:52:27 +01:00
|
|
|
}
|