public virtual void RemoveTrainAt(int index) { Contract.Requires <ArgumentOutOfRangeException>(index >= 0 && index < Trains.Count()); Contract.Assume(index < Trains.Count()); this._trains.RemoveAt(index); }
/// <summary> /// Moves a train at the specified index one step up. /// </summary> /// <param name="index">The index of the train.</param> public virtual void MoveTrainUpAt(int index) { Contract.Requires <ArgumentOutOfRangeException>(index >= 0 && index < Trains.Count()); Contract.Assume(index < this._trains.Count); Train train = this._trains[index]; this._trains.RemoveAt(index); this._trains.Insert(index - 1, train); }