Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace world
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player("Winrar", 100, 80, 20, 3);
- player.PrintInfo();
- Console.ReadKey();
- }
- }
- class Player
- {
- public Player(string name, int health, int mana, int attack, int armor)
- {
- Name = name;
- Health = health;
- Mana = mana;
- Attack = attack;
- Armor = armor;
- }
- public string Name { get; private set; }
- public int Health { get; private set; }
- public int Mana { get; private set; }
- public int Attack { get; private set; }
- public int Armor { get; private set; }
- public void PrintInfo()
- {
- Console.WriteLine($"Игрок {Name}");
- Console.WriteLine($"Атака: {Attack} Защита: {Armor}");
- Console.WriteLine($"Здоровье:\t{Health} ");
- Console.WriteLine($"Мана: \t\t{Mana} ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement