Advertisement
dmitryEfremov

Untitled

Jun 7th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp11
  4. {
  5. class Player
  6. {
  7. private int _health;
  8. private int _damage;
  9. private int _armor;
  10. private string _name;
  11.  
  12.  
  13. public Player(string name, int health, int damage, int armor)
  14. {
  15. _name = name;
  16. _health = health;
  17. _damage = damage;
  18. _armor = armor;
  19. }
  20.  
  21. public void ShowInfo()
  22. {
  23. Console.WriteLine($"Характеристики игрока \"{_name}\"");
  24. Console.WriteLine($"Здоровье равено = {_health}");
  25. Console.WriteLine($"Урон равен = {_damage}");
  26. Console.WriteLine($"Бронь равна = {_armor}");
  27. }
  28. }
  29. class Program
  30. {
  31. static void Main(string[] args)
  32. {
  33. Player player = new Player("Дмитрий",100, 200, 100);
  34. player.ShowInfo();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement