Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLight
- {
- class Player
- {
- public string Name { get; }
- public int Health { get; }
- public int Money { get; set; }
- public Player(string name, int health, int money)
- {
- Name = name;
- Health = health;
- Money = money;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"Статистика игрока {Name}:\n Жизней - {Health}\n Денег - {Money} ");
- }
- }
- class Program
- {
- static void Main()
- {
- Player player1 = new Player("Вася", 150, 0);
- Player player2 = new Player("Олег", 120, 120);
- player1.ShowInfo();
- player2.ShowInfo();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement