* 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>
35 lines
975 B
C#
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;
|
|
}
|
|
}
|