generated from admin/template
61 lines
1.1 KiB
C#
61 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace lab06
|
|
{
|
|
class Pokemon
|
|
{
|
|
|
|
private string name;
|
|
private int level;
|
|
private int hp;
|
|
|
|
|
|
public string Name
|
|
{
|
|
get { return name; }
|
|
set { name = value; }
|
|
}
|
|
|
|
public int Level
|
|
{
|
|
get { return level; }
|
|
set { level = value; }
|
|
}
|
|
|
|
public int HP
|
|
{
|
|
get { return hp; }
|
|
set { hp = value; }
|
|
}
|
|
|
|
|
|
public Pokemon(string name, int level, int hp)
|
|
{
|
|
this.name = name;
|
|
this.level = level;
|
|
this.hp = hp;
|
|
}
|
|
|
|
|
|
public void ShowInfo()
|
|
{
|
|
Console.WriteLine($"Имя: {name}, Уровень: {level}, HP: {hp}");
|
|
}
|
|
}
|
|
|
|
class Program
|
|
{
|
|
static void Main()
|
|
{
|
|
|
|
Pokemon pokemon1 = new Pokemon("Пикачу", 5, 100);
|
|
Pokemon pokemon2 = new Pokemon("Сквиртл", 7, 90);
|
|
|
|
Console.WriteLine("=== ПОКЕДЕКС ===");
|
|
pokemon1.ShowInfo();
|
|
pokemon2.ShowInfo();
|
|
}
|
|
}
|
|
}
|
|
|