//המרת נקודות ממספרים public static void Dopoint(Stand stand, Getaway g) { Point p1 = new Point() { X = Convert.ToInt32(stand.X1), Y = Convert.ToInt32(stand.Y1) }; Point p2 = new Point() { X = Convert.ToInt32(stand.X2), Y = Convert.ToInt32(stand.Y2) }; Point p3 = MidPoint(p1, p2); Point p1g = new Point() { X = Convert.ToInt32(g.X1), Y = Convert.ToInt32(g.Y1) }; Point p2g = new Point() { X = Convert.ToInt32(g.X2), Y = Convert.ToInt32(g.Y2) }; }
//נקודת התחלת הקניה public static List <GetawayProcI_Result> StartPointManagment(Point pStart, int[][] matShop, List <GetawayProcI_Result> getaways, int CodeStartGetaway, List <Stand> stands, Shop shop) { List <int []> listAns = GetStartGetaway(matShop, pStart, matShop.Length, matShop[0].Length); List <GetawayProcI_Result> l = new List <GetawayProcI_Result>(); listAns.ForEach(z => l.Add(getaways.Where(d => d.Code == z[0] && z[1] == Convert.ToInt32(eMatMeaning.getaway)).FirstOrDefault())); l.RemoveAll(z => z == null); if (l == null || l.Count() == 0) { int code = listAns.Where(x => x[1] == Convert.ToInt32(eMatMeaning.stand)).First()[0]; Getaway g = stands.Where(y => y.Code == code).First().GetConnections(shop).First().Getaway; l.Add(Converts.ToGetawayProcResult(g, getaways)); } if (l == null || l.Count() == 0) { l.Add(getaways.Where(x => x.Code == CodeStartGetaway).First()); } //החזרת אזור התחלה שיוסף לרשימת האזורים return(l); }
//מקבל גטווי [של הדאל, ] וממיר אותם כי צריך את האינדקס public static GetawayProcI_Result ToGetawayProcResult(Getaway g, List <GetawayProcI_Result> getawayProcI_Results) { return(getawayProcI_Results.Where(x => x.Code == g.Code).First()); }