コード例 #1
0
ファイル: GameElement.cs プロジェクト: Zaokret/Discord.Broker
 public static IEnumerable <string> GetRoleNames()
 {
     foreach (GameRole role in Enum.GetValues(typeof(GameRole)))
     {
         yield return(GameElement.Role(role));
     }
 }
コード例 #2
0
ファイル: GameElement.cs プロジェクト: Zaokret/Discord.Broker
 public static PollCommandArguments Kick(string name)
 {
     return(new PollCommandArguments
     {
         Title = $"Excommunicate vote",
         Description = $"Is {name} a {GameElement.Role(GameRole.Killer)} ?"
     });
 }
コード例 #3
0
        public static Embed Of(GroupType group, List <PlayerReward> rewardedPlayers)
        {
            EmbedFieldBuilder[] playerScore = rewardedPlayers
                                              .OrderByDescending(s => s.Reward)
                                              .Select(PlayerScore)
                                              .ToArray();

            return(new EmbedBuilder()
                   .WithTitle("S C O R E B O A R D")
                   .WithDescription($"{GameElement.Group(group)} WIN")
                   .WithFields(playerScore)
                   .WithColor(Color.DarkRed)
                   .Build());
        }
コード例 #4
0
        public static EmbedFieldBuilder PlayerScore(PlayerReward obj)
        {
            string description = string.Join("\n", new string[]
            {
                string.Empty,
                $"Role: {GameElement.Role(obj.Player.Role)}",
                $"Alive: {IsAlive(obj.Player.Active)}",
                $"Alive for: {obj.DaysAliveFor} days",
                $"Reward: {obj.Reward} coins"
            });

            return(new EmbedFieldBuilder()
                   .WithIsInline(true)
                   .WithName(obj.Player.User.Username)
                   .WithValue(description));
        }
コード例 #5
0
ファイル: GameElement.cs プロジェクト: Zaokret/Discord.Broker
 public static string InitialRoleReveal(GameRole role)
 => $"Your role is {GameElement.Role(role)}.";
コード例 #6
0
ファイル: GameElement.cs プロジェクト: Zaokret/Discord.Broker
 public static string SeenTheSigns(Player targetPlayer)
 => $"{targetPlayer.User.Username} flocks with {GameElement.Group(targetPlayer.Group)}.";