Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trayforyou/3ec8eef3bc4be64eec652117ee4cf8c2 to your computer and use it in GitHub Desktop.
Save trayforyou/3ec8eef3bc4be64eec652117ee4cf8c2 to your computer and use it in GitHub Desktop.
using System;
namespace OOP_number_1
{
internal class Program
{
static void Main(string[] args)
{
Player player = new Player("Ваня",10);
player.ShowInfo();
}
}
class Player
{
public string Name { get; private set; }
public int Power { get; private set; }
public Player(string name, int power)
{
Name = name;
Power = power;
}
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