示例#1
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            Carriage otherCarriage = obj as Carriage;

            if (otherCarriage != null)
            {
                return(this.Comfort.CompareTo(otherCarriage.Comfort));
            }
            else
            {
                throw new ArgumentException("Обьект не является вагоном");
            }
        }
示例#2
0
 public void ConnectCarriage(Carriage carriage)
 {
     CarriagesConnected.Add(carriage);
 }