示例#1
0
        static void Main()
        {
            Random rand = new Random();

            for (int i = 0; i < 20; ++i)
            {
                Circle circle = (Circle)ShapeFactory.GetCircle(GetRandomColor(rand));
                circle.SetX(GetRandomX(rand));
                circle.SetY(GetRandomY(rand));
                circle.SetRadius(100);
                circle.Draw();
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            for (int i = 0; i < 20; i++)
            {
                Circle circle = (Circle)ShapeFactory.GetCircle(getRandomColor());
                circle.SetX(getRandomX());
                circle.SetY(getRandomY());
                circle.SetRadius(100);
                circle.Draw();
            }

            Console.ReadKey();
        }