Archived
1
0
This repository has been archived on 2025-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
cs-vampi/Spielfigur.cs
2009-01-29 23:44:45 +01:00

37 lines
820 B
C#

using System;
namespace vampi
{
public abstract class Spielfigur {
protected Spielfeld sfeld;
protected int typ;
protected int maxAge = 80;
protected int age = -1;
public int Age {
get { return this.age; }
}
public int Typ {
get { return this.typ; }
}
public Spielfigur(Spielfeld sfeld) {
sfeld.Sfigur = this;
this.sfeld = sfeld;
}
public virtual void runStep() {
if (this.age != -1) {
this.age++;
if (this.age >= this.maxAge) {
this.die();
}
}
}
public virtual void die() {
this.sfeld.Sfigur = null;
}
}
}