public physic(coordinate c_, int mass_) { coordinate_ = c_; mass = mass_; }
public physic(coordinate c_) { coordinate_ = c_; mass = 0; }
/// <summary> /// Назначение новых координат /// </summary> /// <param name="c_"></param> internal void set_cordinate(coordinate c_) { coordinate_pb = c_; }
/// <summary> /// Возвращает имена пересекаемых объектов /// </summary> /// <param name="works_">mime object</param> /// <param name="work_mine">other object</param> /// <returns></returns> internal string[] eql_name_unsafe(List <work> works_, work work_mine) { //work work_ = work_mine; work_mine.update_coordinate(); List <string> names_ = new List <string>(); coordinate mine = work_mine.get_coordinate(); foreach (work item in works_) { item.update_coordinate(); // bool l, r, t, b; //для права coordinate other = item.get_coordinate(); //------------------------------------------ if ((mine.get_coordinate(4)[0] >= other.get_coordinate(4)[0] && mine.get_coordinate(4)[ mine.get_coordinate(4).Length - 1] <= other.get_coordinate(4)[ other.get_coordinate(4).Length - 1]) || (mine.get_coordinate(4)[0] <= other.get_coordinate(4)[ other.get_coordinate(4).Length - 1] && mine.get_coordinate(4)[ mine.get_coordinate(4).Length - 1] > other.get_coordinate(4)[0] // other.get_coordinate(4).Length - 1] ) || (mine.get_coordinate(4)[ mine.get_coordinate(4).Length - 1] >= other.get_coordinate(4)[0] && mine.get_coordinate(4)[0] < other.get_coordinate(4)[ other.get_coordinate(4).Length - 1] ) || (mine.get_coordinate(4)[0] < other.get_coordinate(4)[0] && mine.get_coordinate(4)[ mine.get_coordinate(4).Length - 1] > other.get_coordinate(4)[ other.get_coordinate(4).Length - 1])) { // проверить // проверка иксов if (mine.get_coordinate(1)[0] <= other.get_coordinate(1)[ other.get_coordinate(1).Length - 1] && mine.get_coordinate(1)[ mine.get_coordinate(1).Length - 1] > other.get_coordinate(1)[ other.get_coordinate(1).Length - 1]) { //string name = item.pictureBox1.Name; names_.Add(item.pictureBox1.Name + "^L"); continue; // лево } if ((mine.get_coordinate(1)[0] > other.get_coordinate(1)[0] && mine.get_coordinate(1)[mine.get_coordinate(1).Length - 1] < other.get_coordinate(1)[ other.get_coordinate(1).Length - 1]) || (mine.get_coordinate(1)[0] == other.get_coordinate(1)[0] && mine.get_coordinate(1)[ mine.get_coordinate(1).Length - 1] == other.get_coordinate(1)[ other.get_coordinate(1).Length - 1]) || (mine.get_coordinate(1)[0] < other.get_coordinate(1)[0] && mine.get_coordinate(1)[ mine.get_coordinate(1).Length - 1] > other.get_coordinate(1)[ other.get_coordinate(1).Length - 1])) { names_.Add(item.pictureBox1.Name + "^UD"); continue; // верх/низ } if (mine.get_coordinate(1)[0] <= other.get_coordinate(1)[0] && mine.get_coordinate(1)[ mine.get_coordinate(1).Length - 1] >= other.get_coordinate(1)[0]) { names_.Add(item.pictureBox1.Name + "^R"); continue; // право ДОДЕЛАТЬ } } } return(names_.ToArray()); }
/// <summary> /// Устанавливаем объект по координатам /// </summary> /// <param name="c_">Координаты объекта</param> internal void set_location(coordinate c_) { pictureBox1.Location = new Point(c_.get_coordinate(0)[0], c_.get_coordinate(5)[0]); }