2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Markers;
|
2020-08-13 14:40:27 +02:00
|
|
|
using Content.Shared.Roles;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-01-23 17:31:47 +01:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.ViewVariables;
|
2019-03-17 15:52:27 +01:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Spawners.Components
|
2019-03-17 15:52:27 +01:00
|
|
|
{
|
2019-07-31 15:02:36 +02:00
|
|
|
[RegisterComponent]
|
|
|
|
|
[ComponentReference(typeof(SharedSpawnPointComponent))]
|
2019-03-17 15:52:27 +01:00
|
|
|
public sealed class SpawnPointComponent : SharedSpawnPointComponent
|
|
|
|
|
{
|
2020-08-24 14:10:28 +02:00
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
2020-01-23 17:31:47 +01:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("job_id")]
|
2021-03-16 15:50:20 +01:00
|
|
|
private string? _jobId;
|
|
|
|
|
|
|
|
|
|
[field: ViewVariables(VVAccess.ReadWrite)]
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("spawn_type")]
|
2021-03-16 15:50:20 +01:00
|
|
|
public SpawnPointType SpawnType { get; } = SpawnPointType.Unset;
|
|
|
|
|
|
|
|
|
|
public JobPrototype? Job => string.IsNullOrEmpty(_jobId) ? null : _prototypeManager.Index<JobPrototype>(_jobId);
|
2019-03-17 15:52:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum SpawnPointType
|
|
|
|
|
{
|
|
|
|
|
Unset = 0,
|
|
|
|
|
LateJoin,
|
2020-01-23 17:31:47 +01:00
|
|
|
Job,
|
2020-03-03 20:37:26 +01:00
|
|
|
Observer,
|
2019-03-17 15:52:27 +01:00
|
|
|
}
|
|
|
|
|
}
|