Example #1
0
        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);
        }
Example #2
0
        public void SprawdzenieObjetosci()
        {
            int value = WymiarX * WymiarY * WymiarZ / 1000;

            if (value < 3)
            {
                jakaObjetosc = Objetosc.mala;
            }
            else if (value >= 3 && value <= 5)
            {
                jakaObjetosc = Objetosc.standardowa;
            }
            else
            {
                jakaObjetosc = Objetosc.duza;
            }
        }
Example #3
0
        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);
            }
        }