private void GetPlayerCard(Dictionary <string, object> information) { var type = GameControllerHelper.ConvertObjToEnum <CurrentAction>(information["CurrentAction"]); GetCard(); Status = type; }
private void None(Dictionary <string, object> information) { if (information["CurrentAction"].ToString() == "StartGame") { if (players.Count == 0) { log.Error("Добавьте игроков в игру. Сейчас их " + players.Count); return; } if (!isGameEnded) { log.Info("Игра еще не закончилась"); return; } Status = CurrentAction.StartGame; additionaStatus = CurrentAction.None; if (information.ContainsKey("currentPlayer")) { var op = GameControllerHelper.ConvertObjToEnum <TypePlayer>(information["currentPlayer"]); if (op != players[currentPlayer].type) { currentPlayer = currentPlayer == 1 ? 0 : 1; } } else { Random rnd = new Random(); currentPlayer = rnd.Next(0, 2); } log.Info("Game is started. CurrentPlayer: " + currentPlayer); currentMove = 0; Dictionary <string, object> notify = new Dictionary <string, object>(); if (players[currentPlayer].type == TypePlayer.AI) { notify.Add("CurrentAction", CurrentAction.AIUseCardAnimation); } else { notify.Add("CurrentAction", CurrentAction.GetPlayerCard); } if (information.ContainsKey("CardTricksters")) { specialHand = (List <int>)information["CardTricksters"]; } SendGameNotification(notify); } }