Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main()
- {
- Player player = new Player("Player", 100, 10);
- player.ShowInfo();
- }
- }
- class Player
- {
- private string _name;
- private int _health;
- private int _damage;
- public Player(string name, int health, int damage)
- {
- _name = name;
- _health = health;
- _damage = damage;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"Имя игрока: {_name}; Здоровье: {_health}; Наносимый урон: {_damage};");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement