generated from admin/template
new
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user