Пример #1
0
        static void Main(string[] args)
        {
            var    strangeSquare        = new StrangeSquare(2 * Math.Sqrt(2));
            IShape adaptedStrangeSquare = new SquareAdapter(strangeSquare);

            Console.WriteLine($"Area: {adaptedStrangeSquare.GetArea()}");
            Console.WriteLine($"Perimeter: {adaptedStrangeSquare.GetPerimeter()}");
            Console.ReadKey();
        }
Пример #2
0
 public SquareAdapter(StrangeSquare strangeSquare)
 {
     _strangeSquare = strangeSquare;
     _side          = strangeSquare.GetDiagonal() / Math.Sqrt(2);
 }