Archived
1
0

+ added properties instead of class variables

x removed Typliste (integrated in Einwohner)
This commit is contained in:
2009-01-30 21:57:37 +01:00
parent 422210793e
commit 497fd500d9
9 changed files with 153 additions and 72 deletions
+16 -13
View File
@@ -3,31 +3,34 @@ using System.Collections;
namespace vampi
{
public abstract class Spielfigur {
public abstract class Spielfigur {
public const int F_TYPE = 0;
public const int TYPE_HUMAN = 1;
public const int TYPE_VAMPIRE = 2;
public const int F_AGE = 1;
public const int F_MAXAGE = 2;
public int[] props = new int[20];
protected Spielfeld sfeld;
protected int typ;
protected int maxAge = 80;
protected int age = -1;
public int Age {
get { return this.age; }
get { return this.props[F_AGE]; }
}
public int Typ {
get { return this.typ; }
get { return this.props[F_TYPE]; }
}
public Spielfigur(Spielfeld sfeld) {
public Spielfigur(Spielfeld sfeld) {
sfeld.Sfigur = this;
this.sfeld = sfeld;
this.sfeld = sfeld;
}
public virtual void runStep() {
if (this.age != -1) {
this.age++;
if (this.age >= this.maxAge) {
this.die();
}
this.props[F_AGE]++;
if (this.props[F_AGE] >= this.props[F_MAXAGE]) {
this.die();
}
}