Traveller/scripts/SloganProvider.cs
Cold-Mint 39ca716e3d
Conduct code reviews.
进行代码审查。
2024-06-05 21:38:45 +08:00

25 lines
589 B
C#

using ColdMint.scripts.utils;
using Godot;
namespace ColdMint.scripts;
/// <summary>
/// <para>SloganProvider</para>
/// <para>标语提供器</para>
/// </summary>
public static class SloganProvider
{
private const int MaxSloganIndex = 5;
/// <summary>
/// <para>Swipe the machine to get a slogan</para>
/// <para>刷机获取一个标语</para>
/// </summary>
/// <returns></returns>
public static string? GetSlogan()
{
var index = GD.Randi() % MaxSloganIndex + 1;
return TranslationServerUtils.Translate("slogan_" + index);
}
}