public static DraftManager CreateInstance(IMessageChannel channel, int playerCount = 4, int packIndex = 3, int cardCountPerPack = 15) { // すでにあったらダメ if (DraftManager.channelDictionary.ContainsKey(channel)) { return(null); } var instance = new DraftManager(channel, playerCount, packIndex, cardCountPerPack); DraftManager.channelDictionary.Add(channel, instance); return(instance); }
/// <summary> /// おわる /// </summary> /// <param name="user"></param> /// <returns></returns> public async Task CompletePlayer(IUser user) { if (this.Phase != DraftPhase.Completed) { await this.Channel.SendMessageAsync("まだドラフトが終わっていません"); return; } var p = this.Players[user.Id]; p.IsCompleted = true; if (this.Players.Values.All(p => p.IsCompleted)) { foreach (var player in this.Players.Values) { await player.BrowseStatus(this.Channel); } await this.Channel.SendMessageAsync("ゲームを終了しました"); DraftManager.Destroy(this.Channel); } }