* 27 file diff * 27 file diff 2 * Apply suggestions from code review --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
26 lines
699 B
C#
26 lines
699 B
C#
using Content.Server.Speech.Components;
|
|
using Content.Shared.Speech;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|