2022-09-15 04:45:02 +10:00
|
|
|
using Content.Server.NPC.Systems;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.NPC.Components
|
|
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2023-07-17 15:51:52 +12:00
|
|
|
[Access(typeof(NpcFactionSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class NpcFactionMemberComponent : Component
|
2022-09-15 04:45:02 +10:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Factions this entity is a part of.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite),
|
2023-07-17 15:51:52 +12:00
|
|
|
DataField("factions", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<NpcFactionPrototype>))]
|
2022-09-15 04:45:02 +10:00
|
|
|
public HashSet<string> Factions = new();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cached friendly factions.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public readonly HashSet<string> FriendlyFactions = new();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cached hostile factions.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public readonly HashSet<string> HostileFactions = new();
|
|
|
|
|
}
|
|
|
|
|
}
|