Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public void ReceivePlayer(PlayerScore player)
 {
     this.scores.Add(player);
     ReadScore();
 }
Esempio n. 4
0
 private string PrintScores()
 {
     PlayerScore.PlayerScore plScore = new PlayerScore.PlayerScore();
     plScore.ReadScore();
     return(plScore.GiveScores());
 }