mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
24 lines
670 B
C#
24 lines
670 B
C#
using Content.Server.Speech.Components;
|
|
|
|
namespace Content.Server.Speech.EntitySystems
|
|
{
|
|
public sealed class BackwardsAccentSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<BackwardsAccentComponent, AccentGetEvent>(OnAccent);
|
|
}
|
|
|
|
public string Accentuate(string message)
|
|
{
|
|
var arr = message.ToCharArray();
|
|
Array.Reverse(arr);
|
|
return new string(arr);
|
|
}
|
|
|
|
private void OnAccent(EntityUid uid, BackwardsAccentComponent component, AccentGetEvent args)
|
|
{
|
|
args.Message = Accentuate(args.Message);
|
|
}
|
|
}
|
|
}
|