|
@@ -0,0 +1,48 @@
|
|
|
+using System;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using MafiaTelegramBot.Game.GameRoles;
|
|
|
+using MafiaTelegramBot.Models;
|
|
|
+using MafiaTelegramBot.Resources;
|
|
|
+using Telegram.Bot.Types;
|
|
|
+
|
|
|
+namespace MafiaTelegramBot.Game.GameRooms
|
|
|
+{
|
|
|
+ public partial class GameRoom
|
|
|
+ {
|
|
|
+ public abstract class Role
|
|
|
+ {
|
|
|
+ protected readonly GameRoom Room;
|
|
|
+
|
|
|
+ protected Role(GameRoom room)
|
|
|
+ {
|
|
|
+ Room = room;
|
|
|
+ }
|
|
|
+ public abstract Roles RoleKey { get; }
|
|
|
+
|
|
|
+ protected async Task<Message> DayAction(Player player)
|
|
|
+ {
|
|
|
+
|
|
|
+ //TODO user telling anything in one minute and vote
|
|
|
+ return await Bot.SendWithMarkdown2(player.ChatId, strings.unexpected_error);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected abstract Task<Message> NightAction(Player player);
|
|
|
+
|
|
|
+ public static Role GetNewRoleInstance(Roles roleKey, GameRoom room)
|
|
|
+ {
|
|
|
+ return roleKey switch
|
|
|
+ {
|
|
|
+ Roles.All => new NoneRole(room),
|
|
|
+ Roles.Doctor => new DoctorRole(room),
|
|
|
+ Roles.Mafia => new MafiaRole(room),
|
|
|
+ Roles.Don => new DonRole(room),
|
|
|
+ Roles.Cop => new CopRole(room),
|
|
|
+ Roles.Villager => new VillagerRole(room),
|
|
|
+ Roles.Hooker => new HookerRole(room),
|
|
|
+ Roles.None => new NoneRole(room),
|
|
|
+ _ => throw new ArgumentOutOfRangeException(nameof(roleKey), roleKey, null)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|