NameIdentifierComponent.cs 1.0 KB

1234567891011121314151617181920212223242526
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  3. namespace Content.Shared.NameIdentifier;
  4. /// <summary>
  5. /// Generates a unique numeric identifier for entities, with specifics controlled by a <see cref="NameIdentifierGroupPrototype"/>.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. public sealed partial class NameIdentifierComponent : Component
  9. {
  10. [DataField("group", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<NameIdentifierGroupPrototype>))]
  11. public string Group = string.Empty;
  12. /// <summary>
  13. /// The randomly generated ID for this entity.
  14. /// </summary>
  15. [DataField("identifier"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  16. public int Identifier = -1;
  17. /// <summary>
  18. /// The full name identifier for this entity.
  19. /// </summary>
  20. [DataField("fullIdentifier"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  21. public string FullIdentifier = string.Empty;
  22. }