Exemplo n.º 1
0
        public void AddDefaults()
        {
            Random           rand = new Random();
            int              NElem = rand.Next(2, 11), Rand1, Rand2;
            Grid2D           Gr;
            V5DataCollection DataColl;
            V5DataOnGrid     DataGrid;

            V5List = new List <V5Data>();
            for (int i = 0; i < NElem; i++)
            {
                Rand1 = rand.Next(0, 2);
                Gr    = new Grid2D(100, 100, 18, 18);
                if (Rand1 == 0)
                {
                    DataGrid = new V5DataOnGrid("", DateTime.Now, Gr);
                    DataGrid.InitRandom(0, 9);
                    V5List.Add(DataGrid);
                }
                else
                {
                    Rand2    = rand.Next(1, 10);
                    DataColl = new V5DataCollection("", DateTime.Now);
                    DataColl.InitRandom(Rand2, 3, 18, 3, 5);
                    V5List.Add(DataColl);
                }
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Grid2D point = new Grid2D(100, 100, 18, 18);

            Console.WriteLine("\nPoint 1\n");
            V5DataOnGrid a = new V5DataOnGrid("Pyatakov Nikita", DateTime.Now, point);

            Console.WriteLine("\n");
            a.InitRandom(2, 15);
            Console.WriteLine(a.ToLongString());
            V5DataCollection b = (V5DataCollection)a;

            Console.WriteLine(b.ToLongString());

            Console.WriteLine("\nPoint 2\n");
            V5MainCollection c = new V5MainCollection();

            c.AddDefaults();
            Console.WriteLine(c.ToString());

            Console.WriteLine("\nPoint 3\n");
            Vector2[] array;
            foreach (V5Data obj in c)
            {
                array = obj.NearEqual(2);
                for (int i = 0; i < array.Length; i++)
                {
                    Console.WriteLine("[" + array[i].X + ", " + array[i].Y + "]");
                }
            }
            Console.ReadKey();
        }