示例#1
0
        private double ChangeCordinateY(double y)
        {
            SquareSchanges changes = new SquareSchanges();

            y = changes.MoveY();
            return(y);
        }
示例#2
0
        private double ChangeCordinateSide(double side)
        {
            SquareSchanges changes = new SquareSchanges();
            var            side2   = changes.Scale(side);

            return(side2);
        }
示例#3
0
        private double ChangeCordinateX(double x)
        {
            SquareSchanges changes = new SquareSchanges();

            x = changes.MoveX();
            return(x);
        }
示例#4
0
        public void Test()
        {
            SquareBasic    basic          = new SquareBasic();
            SquareSchanges acts           = new SquareSchanges();
            var            basicPerimeter = acts.GetPerimeter(basic.GetSide());
            var            basicArea      = acts.GetArea(basic.GetSide());

            Console.WriteLine($"Basic square: \nPerimeter = {basicPerimeter}\nArea = {basicArea}\nProperties:{DisplayCurrentProp(basic)}");
            Console.WriteLine("---------------------------");
            double newX         = ChangeCordinateX(basic.GetX());
            double newY         = ChangeCordinateY(basic.GetY());
            double newSide      = ChangeCordinateSide(basic.GetSide());
            Square newSquare    = new Square(newX, newY, newSide);
            var    newPerimeter = acts.GetPerimeter(newSide);
            var    newArea      = acts.GetArea(newSide);

            Console.WriteLine($"\n---------------------------\nNew Square:\nPerimeter = {newPerimeter}\nArea = {newArea}\nAll Properties:{DisplayCurrentProp(newSquare)}");
        }