public BoxClass Kompresuj() { string[] array = Objetosc.Split(' '); double input = Math.Pow(double.Parse(array[0]), 1D / 3); BoxClass c = new BoxClass(input, input, input); return(c); }
public int CompareTo(BoxClass other) { string[] baseBox = Objetosc.Split(' '); string[] otherBox = other.Objetosc.Split(' '); double a = double.Parse(baseBox[0]); double b = double.Parse(otherBox[0]); if (a > b) { return(1); } else if (b > a) { return(-1); } string[] baseFieldBox = Pole.Split(' '); string[] otherFieldBox = other.Pole.Split(' '); double aField = double.Parse(baseFieldBox[0]); double bField = double.Parse(otherFieldBox[0]); if (aField > bField) { return(1); } else if (bField > aField) { return(-1); } else if (A + B + C > other.A + other.B + other.C) { return(1); } else if (A + B + C < other.A + other.B + other.C) { return(-1); } else { return(0); } }