public int CompareTo(ClassArray <T> other) { if (this.Count() > other.Count()) { return(-1); } else if (this.Count() < other.Count()) { return(1); } else { var thisKeys = this.places.Keys.ToList(); var otherKeys = other.places.Keys.ToList(); for (int i = 0; i < this.places.Count; ++i) { if (this.places[thisKeys[i]] is Plane && other.places[thisKeys[i]] is Bombardir) { return(1); } if (this.places[thisKeys[i]] is Bombardir && other.places[thisKeys[i]] is Plane) { return(-1); } if (this.places[thisKeys[i]] is Plane && other.places[thisKeys[i]] is Plane) { return((this.places[thisKeys[i]] is Plane).CompareTo(other.places[thisKeys[i]] is Plane)); } if (this.places[thisKeys[i]] is Bombardir && other.places[thisKeys[i]] is Bombardir) { return((this.places[thisKeys[i]] is Bombardir).CompareTo(other.places[thisKeys[i]] is Bombardir)); } } } return(0); }
public Parking() { parking = new ClassArray <ITechnique>(countPlaces, null); }