Advertisement
trmaxa2820

CSharpTask

Feb 14th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 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.  
  7. namespace CSharpLightTask
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Player player = new Player(20, 10, 45);
  14.             player.ShowStats();
  15.         }
  16.         class Player
  17.         {
  18.             public int Health;
  19.             public int Agility;
  20.             public int Power;
  21.             public int Damage;
  22.  
  23.             public Player(int agility, int power, int damage)
  24.             {
  25.                 Health = 100;
  26.                 Agility = agility;
  27.                 Power = power;
  28.                 Damage = damage;
  29.             }
  30.  
  31.             public void ShowStats()
  32.             {
  33.                 Console.WriteLine("Здоровье персонажа - " + Health + "\nЛовкость персонажа - " + Agility +
  34.                     "\nСила персонажа - " + Power + "\nУрон персонажа - " + Damage);
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement