From 39898a369f5c4a8f68b176979dc9e431967c7054 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 23 Dec 2012 22:45:34 +0100 Subject: [PATCH] added round results --- PartyModeChallenge/PartyModeChallenge.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/PartyModeChallenge/PartyModeChallenge.cs b/PartyModeChallenge/PartyModeChallenge.cs index 354df581..776e8292 100644 --- a/PartyModeChallenge/PartyModeChallenge.cs +++ b/PartyModeChallenge/PartyModeChallenge.cs @@ -26,6 +26,7 @@ namespace Vocaluxe.PartyModes public int CurrentRoundNr; public int NumPlayerAtOnce; public List Combs; + public int[,] Results; public List ResultTable; public List ProfileIDs; } @@ -119,6 +120,7 @@ namespace Vocaluxe.PartyModes public ChallengeRounds Rounds; public List ResultTable; + public int[,] Results; public int CurrentRoundNr; @@ -165,6 +167,7 @@ namespace Vocaluxe.PartyModes GameData.CurrentRoundNr = 1; GameData.ProfileIDs = new List(); GameData.CatSongIndices = null; + GameData.Results = null; } public override bool Init() @@ -305,6 +308,7 @@ namespace Vocaluxe.PartyModes ToScreenMain.ProfileIDs = GameData.ProfileIDs; UpdateScores(); ToScreenMain.ResultTable = GameData.ResultTable; + ToScreenMain.Results = GameData.Results; Screen.DataToScreen(ToScreenMain); } break; @@ -318,7 +322,7 @@ namespace Vocaluxe.PartyModes UpdateScores(); ToScreenMain.CurrentRoundNr = GameData.CurrentRoundNr; ToScreenMain.Combs = GameData.Rounds.Rounds; - + ToScreenMain.Results = GameData.Results; Screen.DataToScreen(ToScreenMain); } break; @@ -574,6 +578,15 @@ namespace Vocaluxe.PartyModes row.NumGamePoints = 0; GameData.ResultTable.Add(row); } + + GameData.Results = new int[GameData.NumRounds, GameData.NumPlayerAtOnce]; + for (int i = 0; i < GameData.NumRounds; i++) + { + for (int j = 0; j < GameData.NumPlayerAtOnce; j++) + { + GameData.Results[i, j] = 0; + } + } } else { @@ -584,6 +597,11 @@ namespace Vocaluxe.PartyModes if (results.Length < GameData.NumPlayerAtOnce) return; + for (int j = 0; j < GameData.NumPlayerAtOnce; j++) + { + GameData.Results[GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points); + } + List points = GetPointsForPlayer(results); for (int i = 0; i < GameData.NumPlayerAtOnce; i++) @@ -623,7 +641,7 @@ namespace Vocaluxe.PartyModes { Stats stat = new Stats(); stat.ProfileID = Results[i].ProfileID; - stat.SingPoints = (int)Results[i].Points; + stat.SingPoints = (int)Math.Round(Results[i].Points); stat.Won = 0; stat.GamePoints = 0; result.Add(stat);