Advertisement
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 Работа_с_классами
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player1 = new Player(100, 10);
- player1.ShowInfo();
- }
- }
- class Player
- {
- private int _health;
- private int _armor;
- public Player(int health, int armor)
- {
- _health = health;
- _armor = armor;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"Здоровье игрока: {_health}\nБроня игрока: {_armor}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement