Simeon1995

Player.cs

Feb 22nd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. public class Player
  6. {
  7. private string name;
  8. private double overallStats;
  9.  
  10. public Player(string name, double overallStats)
  11. {
  12. this.Name = name;
  13. this.overallStats = overallStats;
  14. }
  15.  
  16. public string Name
  17. {
  18. get { return this.name; }
  19. set
  20. {
  21. if(string.IsNullOrWhiteSpace(value))
  22. {
  23. throw new ArgumentException("A name should not be empty.");
  24. }
  25. this.name = value;
  26. }
  27. }
  28.  
  29. public double GetStats
  30. {
  31. get { return this.overallStats; }
  32. }
  33. }
Add Comment
Please, Sign In to add comment