public void Reach(RacePlayer player, CheckPoint check) { if (check.CheckPointIndex == CheckPointIndex(player.Checks + 1)) { //richtiger checkpoint, ganz klasse player.Checks++; Announce(player.Name + " reached " + player.Checks + "."); if (Lap(player.Checks) >= Laps && Laps>0) { Finish(player); } } }
protected void Finish(RacePlayer player) { Announce(player.Name + " finished."); EndGame(); }
public CheckPoint GetNextCheckPoint(RacePlayer player) { CheckPoint[] list = CheckPoints; foreach (CheckPoint p in list) { if (p.CheckPointIndex == CheckPointIndex(player.Checks + 1)) { return p; } } return null; }