private void button1_Click(object sender, EventArgs e) { int points = rnd.Next(100, 10000); string playerName = txtBoxPlayerName.Text; PlayerScore.PlayerScore player = new PlayerScore.PlayerScore(playerName, points); player.ReceivePlayer(player); this.game.GameStage = Enums.GameStage.Game; this.Close(); }
private void AddPlayerScores(string[] playerInfo) { string pattern = @"\s(.+?)\s([0-9]+)"; foreach (var player in playerInfo) { Match m = Regex.Match(player, pattern); PlayerScore plScore = new PlayerScore(m.Groups[1].Value, int.Parse(m.Groups[2].Value)); this.scores.Add(plScore); } }
public void ReceivePlayer(PlayerScore player) { this.scores.Add(player); ReadScore(); }
private string PrintScores() { PlayerScore.PlayerScore plScore = new PlayerScore.PlayerScore(); plScore.ReadScore(); return(plScore.GiveScores()); }