private string GetPlayerXmlAttributes(string playerName, MatchPlayer player) { return(String.Format(@"<{0} id='{1}' nickname='{2}' points='{3}' guid='{4}' tag='{5}'/>", playerName, player.Id, player.Name, player.Points, player.Guid, player.Tag)); }
public void UpdateNextMatches() { MatchPlayer looser = null; MatchPlayer winner = null; if (Looser_Match != null) { looser = Looser_Match.GetPlayerByLetter(Loosers_MatchLabel.Letter); } if (Winner_Match != null) { winner = Winner_Match.GetPlayerByLetter(Winners_MatchLabel.Letter); } if (winner == null) { return; } if (PlayerA.Id == -1 || PlayerB.Id == -1) { if (looser != null) { looser.Id = -1; } if (winner != null) { winner.Id = -1; } } if (PlayerA.Id == 0) { if (winner != null) { winner.Copy(PlayerB); } if (looser != null) { looser.Id = 0; } } if (PlayerB.Id == 0) { if (winner != null) { winner.Copy(PlayerA); } if (looser != null) { looser.Id = 0; } } if (PlayerA.Id > 0 && PlayerB.Id > 0) // здесь было && { switch (Winner) { case MatchLabel.PlayerLetters.A: if (looser != null) { looser.Copy(PlayerB); } if (winner != null) { winner.Copy(PlayerA); } break; case MatchLabel.PlayerLetters.B: if (looser != null) { looser.Copy(PlayerA); } if (winner != null) { winner.Copy(PlayerB); } break; case MatchLabel.PlayerLetters.Unknown: if (looser != null) { looser.Id = -1; } if (winner != null) { winner.Id = -1; } break; } } if (Looser_Match != null) { Looser_Match.UpdateNextMatches(); } if (Winner_Match != null) { Winner_Match.UpdateNextMatches(); } }