コード例 #1
0
        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();
            }
        }
コード例 #2
0
 public void Add(GearBase gear)
 {
     gear.LapCompleted += new Events.LapCompleteEventHandler(gear_LapCompleted);
     this.gears.Add(gear);
 }