Use GUID instead of int for player-ids; ID is now unique and saved to player.xml-file

This commit is contained in:
Florian Küpper committed 2015-12-23 14:23:55 +01:00
1 parent 804647f480
commit e3497641dd
29 files changed
+275 -235

No files matched your search

@@ -27,7 +27,7 @@ namespace VocaluxeLib.PartyModes.Challenge
public class CResultTableRow : IComparable
{
public int Position;
public int PlayerID;
public Guid PlayerID;
public int NumPlayed;
public int NumWon;
public int NumSingPoints;
@@ -116,7 +116,7 @@ namespace VocaluxeLib.PartyModes.Challenge
public int NumJokers;
public bool RefillJokers;
public int[] Jokers;
public List<int> ProfileIDs;
public List<Guid> ProfileIDs;
public CChallengeRounds Rounds;
public List<CResultTableRow> ResultTable;
@@ -129,7 +129,7 @@ namespace VocaluxeLib.PartyModes.Challenge
private struct SStats
{
public int ProfileID;
public Guid ProfileID;
public int SingPoints;
public int GamePoints;
public int Won;
@@ -150,7 +150,7 @@ namespace VocaluxeLib.PartyModes.Challenge
_ScreenSongOptions.Sorting.SearchActive = false;
_ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.NoDuets;
GameData = new SData {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12, NumJokers = 5, RefillJokers = true, CurrentRoundNr = 1, ProfileIDs = new List<int>(), CatSongIndices = null, Results = null};
GameData = new SData {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12, NumJokers = 5, RefillJokers = true, CurrentRoundNr = 1, ProfileIDs = new List<Guid>(), CatSongIndices = null, Results = null};
}
public override bool Init()
@@ -358,7 +358,7 @@ namespace VocaluxeLib.PartyModes.Challenge
if (c != null)
players[i].ProfileID = GameData.ProfileIDs[c.Players[i]];
else
players[i].ProfileID = -1;
players[i].ProfileID = Guid.Empty;
}
CBase.Graphics.FadeTo(EScreen.Sing);
@@ -340,7 +340,7 @@ namespace VocaluxeLib.PartyModes.Challenge
_Texts[_TextNextPlayerMessage].Visible = true;
for (int i = 0; i < _PartyMode.GameData.NumPlayerAtOnce; i++)
{
int id = _PartyMode.GameData.ProfileIDs[_PartyMode.GameData.Rounds[_PartyMode.GameData.CurrentRoundNr - 1].Players[i]];
Guid id = _PartyMode.GameData.ProfileIDs[_PartyMode.GameData.Rounds[_PartyMode.GameData.CurrentRoundNr - 1].Players[i]];
_NextPlayerStatics[i].Texture = CBase.Profiles.GetAvatar(id);
_NextPlayerTexts[i].Text = CBase.Profiles.GetPlayerName(id);
_NextPlayerTexts[i].Color = CBase.Themes.GetPlayerColor(i + 1);
@@ -15,6 +15,7 @@
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using VocaluxeLib.Menu;
@@ -46,7 +47,7 @@ namespace VocaluxeLib.PartyModes.Challenge
while (_PartyMode.GameData.ProfileIDs.Count > _NumPlayer)
_PartyMode.GameData.ProfileIDs.RemoveAt(_PartyMode.GameData.ProfileIDs.Count - 1);
List<int>[] ids = new List<int>[] {_PartyMode.GameData.ProfileIDs};
List<Guid>[] ids = new List<Guid>[] {_PartyMode.GameData.ProfileIDs};
SetPartyModeProfiles(ids);
}