public Vise(Vector2 A, Vector2 B, DragObj C, DragObj D) { stat1 = A; stat2 = B; st1 = C; st2 = D; colorvise = Color.Black; nice = false; }
public void Update(List<Obstacle> Lob, DragObj Ldo) { bool inter = false; A = new Point((int)pos.X + 15, (int)pos.Y + 25); // for (int index = 0; index < Lob.Count(); index++) // { B = new Point((int)Ldo.Shape.Center.X, (int)Ldo.Shape.Center.Y); for (int j = 0; j < Lob.Count(); j++) // verif si elel est allume avec 1 station sinon relancer { if (inter = interclass.LineIntersectsRect(A, B, Lob[j].Shape)) { inter = true; islight = false; break; } else { inter = false; } } if (inter == false) { // coments are there for multi dragobj if (islight == false) islight = true; //break; } //} }
// button trash public void rmone_station_list(DragObj sel) { // line de limitation du nombre de gps, du coup on peut pas les supprimer c'est plus simple ? if (sel.IsGps == false) { if (sel.isvise == true) { istake = false; } if (ListDragObj.Count() > 0) { // boucle qui supprime une visé si on suppr une station visé // bug si plusieur visé sur la station removed // verifié chaque visé avec le drag obj foreach (Vise vs in ListVise) { if ((sel == vs.st1) || (sel == vs.st2)) { ListVise.Remove(vs); break; } } ListDragObj.Remove(sel); } } }
public void Mouseclik(int x, int y) { Rectangle mouserec = new Rectangle(x, y, 10, 10); //Ester Egg geosat //if (mouserec.Intersects(ButtonPauseRect)) // { // if (PausePopUp) // PausePopUp = false; // else // PausePopUp = true; // } if (butaddrect.Intersects(mouserec)) { DragObj newone; newone = new DragObj(); newone.Initialize(textgps, new Vector2(rw(320), rh(335)), textgpssel, false); add_station_list(newone); } else if (addgpsrect.Intersects(mouserec)) { DragObj newone; if (counter < 2) { counter += 1; newone = new DragObj(); newone.Initialize(textstation, new Vector2(rw(380), rh(335)), textstationsel, true); add_station_list(newone); } } for (int i = 0; i < ListDragObj.Count(); i++) { if (ListDragObj[i].Shape.Intersects(btlessrect)) { rmone_station_list(ListDragObj[i]); } } }
public void add_station_list(DragObj justcreated) { // Limitation a 30 station pour le moment if (ListDragObj.Count() < 30) ListDragObj.Add(justcreated); }
public void AddToDragObjList(DragObj ToAdd) { ListDragObj.Add(ToAdd); }