public void PrintResult(ResultGame result) { if (result == ResultGame.Correct) { _utility.ShowMeesage( "You succeeded", "succeeded", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (result == ResultGame.Bigger) { _utility.ShowMeesage( "Your number is bigger", "more", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (result == ResultGame.Smaller) { _utility.ShowMeesage( "Your number is small", "less", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public void GameOver() { isGameOver = true; isStartGame = false; if (scorePlayer1 > scorePlayer2) { winner = PLAYER1; resultTxt.text = NetworkClient.users[PLAYER1].name + " is the winner!!!!"; } else if (scorePlayer2 > scorePlayer1) { winner = PLAYER2; resultTxt.text = NetworkClient.users[PLAYER2].name + " is the winner!!!!"; } else//ticko { winner = "ticko"; resultTxt.text = "Ticko"; } resultPlayer1Txt.text = NetworkClient.users[PLAYER1].name + "'s score : " + scorePlayer1.ToString(); resultPlayer2Txt.text = NetworkClient.users[PLAYER2].name + "'s score : " + scorePlayer2.ToString(); ResultGame resultGame = new ResultGame(); resultGame.winnerId = winner; playersNet[NetworkClient.clientID].GetSocket().Emit("gameOver", new JSONObject(JsonUtility.ToJson(resultGame))); Debug.Log("send game over"); }
//fin del juego private void EndGame(ResultGame result) { //mostramos el resultado por mensaje bool lose = true; bool empate = false; if (result == ResultGame.Tie) { finalMessage.text = "Tablas"; finalMessage.color = Color.red; lose = false; empate = true; } else if (result == ResultGame.PlayerWin) { finalMessage.text = "El jugador gana la mano"; lose = false; } else if (result == ResultGame.PlayerLose) { finalMessage.text = "El dealer gana la mano"; } else if (result == ResultGame.BlackjackPlayerLose) { finalMessage.text = "Blackjack!! El dealer gana la mano"; } else if (result == ResultGame.BlackjackPlayerWin) { finalMessage.text = "Blackjack!! El jugador gana la mano"; lose = false; } if (lose == false && empate == false) { //si gana recibe el doble de dinero apostado dinero = dinero + (saldoEnJuego * 2); finalMessage.color = Color.yellow; } else { finalMessage.color = Color.red; } saldoEnJuego = 0; actualizarTextoSaldo(); dealer.GetComponent <CardHand>().cards[0].GetComponent <CardModel>().ToggleFace(true); InteractButtons(false); //si el jugador se queda sin dinero if (dinero == 0) { finalMessage.text = "Pierdes!! No tienes dinero para jugar"; //no puedes volver a jugar playAgainButton.interactable = false; } }
public static void PrintResult(ResultGame resGame) { if (resGame == ResultGame.Draw) { Console.WriteLine("Ничья! Раунд завершен"); } if (resGame == ResultGame.Loss) { Console.WriteLine("Вы проиграли! Раунд завершен"); } if (resGame == ResultGame.Win) { Console.WriteLine("Поздравляю. Вы выйграли! Раунд завершен"); } }
public void PrintResult(ResultGame result) { if (result == ResultGame.Correct) { _utility.PrintText("You succeeded", ConsoleColor.Green); } else if (result == ResultGame.Bigger) { _utility.PrintText("Your number is bigger", ConsoleColor.Red); } else if (result == ResultGame.Smaller) { _utility.PrintText("Your number is small", ConsoleColor.Yellow); } }
public void onClickBack() { isClosedGameLooby = true; ResultGame resultGame = new ResultGame(); resultGame.winnerId = NetworkClient.clientID; NetworkClient.users[NetworkClient.clientID].socket.Emit("gameOver", new JSONObject(JsonUtility.ToJson(resultGame))); isClosedGameLooby = true; Debug.Log("isclosed=" + isClosedGameLooby); GameObject.FindGameObjectWithTag("camera").SetActive(true); if (MainMenuManager.currentLevelGame == SceneList.MULTIPLAYER_LEVEL1) { SceneManagementManager.Instance.UnLoadLevel(SceneList.MULTIPLAYER_LEVEL1); } else if (MainMenuManager.currentLevelGame == SceneList.MULTIPLAYER_LEVEL2) { SceneManagementManager.Instance.UnLoadLevel(SceneList.MULTIPLAYER_LEVEL2); } }
private void FinishRound(ResultGame res) { _gamer.State = StatusPlayer.Play; _croupier.State = StatusPlayer.Play; _gamer.GiveBackCards(); _croupier.GiveBackCards(); if (res == ResultGame.Draw) { PrintInfo.PrintResult(ResultGame.Draw); } if (res == ResultGame.Loss) { _gamer.Loss += 1; PrintInfo.PrintResult(ResultGame.Loss); } if (res == ResultGame.Win) { _gamer.Win += 1; PrintInfo.PrintResult(ResultGame.Win); } }