Rename Faction to NpcFaction (#18079)

This commit is contained in:
Leon Friedrich
2023-07-17 15:51:52 +12:00
committed by GitHub
parent f8c94bd76c
commit 541eb417e3
37 changed files with 108 additions and 109 deletions

View File

@@ -4,14 +4,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.NPC.Components
{
[RegisterComponent]
[Access(typeof(FactionSystem))]
public sealed class FactionComponent : Component
[Access(typeof(NpcFactionSystem))]
public sealed class NpcFactionMemberComponent : Component
{
/// <summary>
/// Factions this entity is a part of.
/// </summary>
[ViewVariables(VVAccess.ReadWrite),
DataField("factions", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<FactionPrototype>))]
DataField("factions", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<NpcFactionPrototype>))]
public HashSet<string> Factions = new();
/// <summary>

View File

@@ -1,23 +1,22 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.NPC.Components
{
/// <summary>
/// Contains data about this faction's relations with other factions.
/// </summary>
[Prototype("faction")]
public sealed class FactionPrototype : IPrototype
[Prototype("npcFaction")]
public sealed class NpcFactionPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
[ViewVariables(VVAccess.ReadWrite), DataField("friendly", customTypeSerializer:typeof(PrototypeIdListSerializer<FactionPrototype>))]
[ViewVariables(VVAccess.ReadWrite), DataField("friendly", customTypeSerializer:typeof(PrototypeIdListSerializer<NpcFactionPrototype>))]
public List<string> Friendly = new();
[ViewVariables(VVAccess.ReadWrite), DataField("hostile", customTypeSerializer:typeof(PrototypeIdListSerializer<FactionPrototype>))]
[ViewVariables(VVAccess.ReadWrite), DataField("hostile", customTypeSerializer:typeof(PrototypeIdListSerializer<NpcFactionPrototype>))]
public List<string> Hostile = new();
}
}