Created
May 12, 2024 07:24
-
-
Save trayforyou/460591c2d53a7b149a4301738cf2c89d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace OOP_number_1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Player player = new Player("Ваня",10); | |
player.ShowInfo(); | |
} | |
} | |
class Player | |
{ | |
public Player(string name, int power) | |
{ | |
Name = name; | |
Power = power; | |
} | |
public string Name { get; private set; } | |
public int Power { get; private set; } | |
public void ShowInfo() | |
{ | |
Console.WriteLine($"Игрок {Name} обладает силой в {Power} ед."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment