public MainWindow(bool isAi, string player1Name, string player2Name) { InitializeComponent(); ScoreBoardView.CreatePlayer(); Player1Text.Text = player1.firstName = player1Name; if (isAi) { Player2Text.Text = player2.firstName = "AI"; } else { Player2Text.Text = player2.firstName = player2Name; } this.isAI = isAi; playerTurn = RandomizeStartingPlayer(); playerTurnColors(playerTurn); if (isAI && playerTurn == 1) { int aistep = game.aiStepInd(); game.gameStep(aistep, playerTurn + 1); playerTurn = (playerTurn + 1) % 2; playerTurnColors(playerTurn); } drawBoard(); }
public GameModel(PlayerType _Player, ScoreBoardView _scoreBoardView) { Player = _Player; HostScore = GuestScore = 0; Field = new FieldModel(); scoreBoardView = _scoreBoardView; }
private void endGameTitle() { string winner = ""; int winnerPoint = 0; if (player1.Score > player2.Score) { winner = player1.firstName; winnerPoint = player1.Score; MessageBox.Show("A játék véget ért. \n A játék nyertese : " + winner + " " + winnerPoint + "Ponttal"); } else if (player1.Score == player2.Score) { MessageBox.Show("A játék véget ért. \nA játék döntettlen!"); } else { winner = player2.firstName; winnerPoint = player2.Score; MessageBox.Show("A játék véget ért. \n A játék nyertese : " + winner + " " + winnerPoint + "Ponttal"); } ScoreBoardView.SavePlayer(player1); ScoreBoardView.SavePlayer(player2); endOfGame = true; drawBoard(); }
public void ChangeWindowLeaderboard() { MusicEngine.ButtonSoundEffect(); MusicEngine.StartStop(); var window = Application.Current.Windows.OfType <Window>().SingleOrDefault(w => w.IsActive); ScoreBoardView scoreBoardView = new ScoreBoardView(); scoreBoardView.Show(); window.Close(); }
private void CheckEndGame() { if (actualSongType.End) { if (actualSongType is SongController) { _currentStage = GameStages.SCOREBOARD; scoreBoardView = new ScoreBoardView(songResources); DrawResults(); } else { _currentStage = GameStages.MENU; } MediaPlayer.Stop(); EndGame = true; } }
/************SCORE BOARD******************/ public async Task <IActionResult> ScoreBoard() { var scoreView = new ScoreBoardView(); scoreView.GolferList = CalculateHoles().ToList(); int total = 0; foreach (var s in scoreView.GolferList) { foreach (var sc in s.ScoreList) { total = total + sc; } s.Total = total; total = 0; } return(View(scoreView)); }
private void LoadPeopleList() { list = ScoreBoardView.LoadPeople(); list = list.OrderByDescending(Player => Player.Score).ToList(); }
private void ShowScoreBoard() { var scoreBoardView = new ScoreBoardView(); scoreBoardView.Show(); }