generated from admin/template
Добавить works/lab-06
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
|
||||
namespace PokemonApp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("=== ПОКЕДЕКС ===");
|
||||
|
||||
Pokemon pokemon1 = new Pokemon("Пикачу", 5, 100);
|
||||
Pokemon pokemon2 = new Pokemon("Сквиртл", 7, 90);
|
||||
|
||||
pokemon1.ShowInfo();
|
||||
pokemon2.ShowInfo();
|
||||
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user