120 lines
2.8 KiB
C#
Raw Normal View History

2024-12-05 08:56:01 +01:00
namespace TestNetRewarder
2024-10-10 11:45:04 +02:00
{
public class EmojiMaps
{
2024-10-10 14:03:42 +02:00
private readonly string[] emojis = new[]
2024-10-10 11:45:04 +02:00
{
2024-10-10 14:03:42 +02:00
// red
2024-12-05 08:56:01 +01:00
"❤",
2024-10-10 14:03:42 +02:00
"🦞",
"🌹",
"🍒",
"🫖", // teapot
"⛩",
"🚗",
"🔥",
2024-12-05 08:56:01 +01:00
// orange
"🧡",
"🏀",
"🦊",
"🏵",
"🍊",
"🥕",
"🧱",
"🎃",
// yellow
"💛",
"🌻",
"🍋",
"🧀",
"🌔",
"⭐",
"⚡",
"🏆",
2024-10-10 14:03:42 +02:00
// green
2024-12-05 08:56:01 +01:00
"💚",
2024-10-10 14:03:42 +02:00
"🦎",
"🐛",
"🌳",
"🍀",
"🧩",
"🔋",
"♻",
2024-12-05 08:56:01 +01:00
2024-10-10 14:03:42 +02:00
// blue
"💙",
"🐳",
2024-12-05 08:56:01 +01:00
"♂",
2024-10-10 14:03:42 +02:00
"🍉",
"🧊",
"🌐",
"⚓",
"🌀",
2024-12-05 08:56:01 +01:00
// purple
"💜",
"🪀", //yo-yo
"🔮",
"😈",
"👾",
"🪻", // plant hyacinth
"🍇",
"🍆",
// pink
"🩷", // pink heart
"👚",
"♀",
"🧠",
"🐷",
"🦩",
"🌸",
"🌷"
2024-10-10 11:45:04 +02:00
};
2024-12-05 08:56:01 +01:00
public string NewRequest => "🌱";
public string Started => "🌳";
2024-10-10 14:03:42 +02:00
public string SlotFilled => "🟢";
public string SlotRepaired => "♻";
2024-10-10 14:03:42 +02:00
public string SlotFreed => "⭕";
public string SlotReservationsFull => "☑️";
public string Finished => "✅";
public string Cancelled => "🚫";
public string Failed => "❌";
2025-03-04 15:58:45 +01:00
public string ProofSubmitted => "🎵";
public string ProofReport => "🔎";
public string NoProofsMissed => "🎉";
public string ManyProofsMissed => "😱";
2024-10-10 11:45:04 +02:00
2024-10-10 14:03:42 +02:00
public string StringToEmojis(string input, int outLength)
2024-10-10 11:45:04 +02:00
{
2024-10-10 14:03:42 +02:00
if (outLength < 1) outLength = 1;
2024-10-10 11:45:04 +02:00
2024-10-10 14:03:42 +02:00
var result = "";
var segmentLength = input.Length / outLength;
if (segmentLength < 1)
{
return StringToEmojis(input + input, outLength);
}
for (var i = 0; i < outLength; i++)
{
var segment = input.Substring(i * segmentLength, segmentLength);
result += SelectOne(segment);
}
return result;
2024-10-10 11:45:04 +02:00
}
2024-10-10 14:03:42 +02:00
private string SelectOne(string segment)
2024-10-10 11:45:04 +02:00
{
2024-10-10 14:03:42 +02:00
var index = 0;
foreach (var c in segment) index += Convert.ToInt32(c);
index = index % emojis.Length;
return emojis[index];
2024-10-10 11:45:04 +02:00
}
}
}