mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-04 13:27:30 +00:00
27 lines
717 B
C#
27 lines
717 B
C#
using System;
|
|
using Content.Server.Speech.Components;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|