void gear_LapCompleted(GearBase gear) { int index = this.gears.IndexOf(gear); index++; if (index == this.gears.Count)//non ci sono altri ingranaggi { isCurrentable = false; if (this.Completed != null) { this.Completed(this); } } else { this.gears[index].Turn(); } }
public void Add(GearBase gear) { gear.LapCompleted += new Events.LapCompleteEventHandler(gear_LapCompleted); this.gears.Add(gear); }