// behaviour public void AddPlayer(FootBallPlayer player) { this.Rating = CalculatePlayerRating(player); if (!this.players.ContainsKey(player.Name)) { this.players.Add(player.Name, player); } }
private int CalculatePlayerRating(FootBallPlayer player) //used for AddPlayer { int ratning = 0; rating = player.Endurance + player.Sprint + player.Drible + player.Shooting + player.Passing; switch (rating) { case 0: return(rating); break; default: rating /= 5; return(rating); break; } }