Advertisement
alexey3017

Untitled

Mar 24th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Learn1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Player player = new Player();
  13.             player.ShowInfo();
  14.         }
  15.     }
  16.     class Player
  17.     {
  18.         private int _health;
  19.         private int _armor;
  20.         private string _name;
  21.         private int _damage;
  22.  
  23.         public Player()
  24.         {
  25.             _health = 100;
  26.             _armor = 20;
  27.             _damage = 15;
  28.             _name = "Квадд";
  29.         }
  30.  
  31.         public void ShowInfo()
  32.         {
  33.             Console.WriteLine($"Имя игрока: {_name}\nЖизни игрока: {_health}\nБроня игрока: {_armor}\nУрон игрока:{_damage}");
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement