Advertisement
LeRoY_Go

Untitled

Jun 28th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp4
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. Player player1 = new Player("МАКС", 5, 157);
  10. Player player2 = new Player("КАРЛ", 9, 397);
  11. Player player3 = new Player("ДЖОН", 1, 10);
  12. player1.TextInfo();
  13. player2.TextInfo();
  14. player3.TextInfo();
  15.  
  16. Console.ReadKey();
  17. }
  18. }
  19.  
  20. class Player
  21. {
  22. private string _name;
  23. private int _level;
  24. private int _experience;
  25.  
  26. public Player(string name, int level, int experience)
  27. {
  28. _name = name;
  29. _level = level;
  30. _experience = experience;
  31. }
  32.  
  33. public void TextInfo()
  34. {
  35. Console.WriteLine("Имя - " + _name + " | " + "Уровень - " + _level + " | " + "Уровень - " + _experience);
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement