Esempio n. 1
0
        public List <Point> Get(List <Employee> employees)
        {
            int minCoordinate = 0;
            int maxCoordinate = 19;
            int maxIndex      = 1;
            int minIndex      = 0;

            int[]        changeCoordinate = { -1, 1 };
            List <Point> points           = new List <Point>();

            for (int i = 0; i < employees.Count; i++)
            {
                if (employees[i].Position.X > minCoordinate && employees[i].Position.Y > minCoordinate && employees[i].Position.X < maxCoordinate && employees[i].Position.Y < maxCoordinate)
                {
                    points.Add(new Point {
                        X = employees[i].Position.X + changeCoordinate[RandomNumber.Get(minIndex, maxIndex)], Y = employees[i].Position.Y + changeCoordinate[RandomNumber.Get(minIndex, maxIndex)]
                    });
                }
                else
                {
                    points.Add(new Point {
                        X = RandomNumber.Get(minCoordinate, maxCoordinate), Y = RandomNumber.Get(minCoordinate, maxCoordinate)
                    });
                }
            }
            return(points);
        }
Esempio n. 2
0
        public List <Point> GetPoints(int size)
        {
            int          minCoordinate = 0;
            int          maxCoordinate = 19;
            List <Point> points        = new List <Point>();

            for (int i = 0; i < size; i++)
            {
                points.Add(new Point {
                    X = RandomNumber.Get(minCoordinate, maxCoordinate), Y = RandomNumber.Get(minCoordinate, maxCoordinate)
                });
            }
            return(points);
        }
Esempio n. 3
0
        public List <Customer> Get()
        {
            int             size          = 10;
            int             minPrice      = 100;
            int             maxPrice      = 1000;
            PositionOnMap   positionOnMap = new PositionOnMap();
            List <Customer> customers     = new List <Customer>();

            for (int i = 0; i < size; i++)
            {
                customers.Add(new Customer {
                    Price = RandomNumber.Get(minPrice, maxPrice), Position = positionOnMap.GetPoints(size)[i]
                });
            }
            return(customers);
        }