generated from admin/template
34 lines
601 B
C#
34 lines
601 B
C#
class Pokemon
|
|
{
|
|
public string Name;
|
|
public int Level;
|
|
public int HP;
|
|
|
|
|
|
public int HP
|
|
{
|
|
get { return hp; }
|
|
set
|
|
{
|
|
if (value < 0) hp = 0;
|
|
else if (value > 100) hp = 100;
|
|
else hp = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
class Pikachu : Pokemon
|
|
{
|
|
public Pikachu(string name, int level) : base(name, level)
|
|
{
|
|
// тут можно добавить что-то своё
|
|
}
|
|
}
|
|
|
|
|
|
Console.WriteLine("=== ТУРНИР: ВСЕ ПРОТИВ ВСЕХ ===");
|
|
|
|
abstract class Pokemon
|
|
{
|
|
public abstract void Attack();
|
|
} |