Files
tbd-station-14/Content.Shared/Roles/RoleCodeword/RoleCodewordComponent.cs
slarticodefast a3b82e9afd Cleanup SharedRoleCodewordSystem (#38310)
* cleanup

* Update Content.Shared/Roles/RoleCodeword/SharedRoleCodewordSystem.cs

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2025-06-27 02:27:25 +02:00

35 lines
975 B
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Roles.RoleCodeword;
/// <summary>
/// Used to display and highlight codewords in chat messages on the client.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedRoleCodewordSystem), Other = AccessPermissions.Read)]
public sealed partial class RoleCodewordComponent : Component
{
/// <summary>
/// Contains the codewords tied to a role.
/// Key string should be unique for the role.
/// </summary>
[DataField, AutoNetworkedField]
public Dictionary<string, CodewordsData> RoleCodewords = new();
}
[DataDefinition, Serializable, NetSerializable]
public partial struct CodewordsData
{
[DataField]
public Color Color;
[DataField]
public List<string> Codewords;
public CodewordsData(Color color, List<string> codewords)
{
Color = color;
Codewords = codewords;
}
}