Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Homework1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(50, 18, 25);
- player.ShowInfo();
- }
- }
- class Player
- {
- private int _health;
- private int _armor;
- private int _damage;
- private string _name;
- public Player(int health, int armor, int damage, string name = "Default Player")
- {
- _health = health;
- _armor = armor;
- _damage = damage;
- _name = name;
- }
- public void ShowInfo()
- {
- Console.WriteLine("Здоровье - " + _health +
- "\nБроня - " + _armor +
- "\nУрон - " + _damage +
- "\nИмя - " + _name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment