mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-15 13:21:11 +03:00
* Functional product * Bugfix * Handle empty case gracefully * Fix inserting bad values * First set of tests * Don't need this * Dont add empty modifers to names Signed-off-by: Connor Huffine <chuffine@gmail.com> * Typo and [SubscribeLocalEvent] Signed-off-by: Connor Huffine <chuffine@gmail.com> * Refactor GenerateUniqueName to GenerateUniqueNameModifier Signed-off-by: Connor Huffine <chuffine@gmail.com> * Fix returning name when empty Signed-off-by: Connor Huffine <chuffine@gmail.com> * Docs Signed-off-by: Connor Huffine <chuffine@gmail.com> * Tests Signed-off-by: Connor Huffine <chuffine@gmail.com> * Fix comment Signed-off-by: Connor Huffine <chuffine@gmail.com> * Fix FTL test Signed-off-by: Connor Huffine <chuffine@gmail.com> * Add adjectives Signed-off-by: Connor Huffine <chuffine@gmail.com> * Amateur hour Signed-off-by: Connor Huffine <chuffine@gmail.com> * Simplify spawning Signed-off-by: Connor Huffine <chuffine@gmail.com> * Even more streamlined Signed-off-by: Connor Huffine <chuffine@gmail.com> * Improve comment Signed-off-by: Connor Huffine <chuffine@gmail.com> * Apply suggestions from code review Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com> Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com> --------- Signed-off-by: Connor Huffine <chuffine@gmail.com> Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com> Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>
29 lines
919 B
C#
29 lines
919 B
C#
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.NameIdentifier;
|
|
|
|
/// <summary>
|
|
/// Generates a unique numeric identifier for entities, with specifics controlled by a <see cref="NameIdentifierGroupPrototype"/>.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class NameIdentifierComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The group prototype that defines the behavior of the identifier.
|
|
/// </summary>
|
|
[DataField]
|
|
public ProtoId<NameIdentifierGroupPrototype>? Group;
|
|
|
|
/// <summary>
|
|
/// The randomly generated ID for this entity.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public int Identifier = -1;
|
|
|
|
/// <summary>
|
|
/// The full name identifier for this entity.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public string FullIdentifier = string.Empty;
|
|
}
|