예제 #1
0
파일: day_03.cs 프로젝트: LEPT0N/toybox
            public c_intersection[] get_intersections(c_line_segment other)
            {
                c_rectangle intersection = size.get_intersection(other.size);

                if (intersection != null)
                {
                    return(intersection.to_int_vectors().Select(i => new c_intersection(i, base_distance + i.taxi_distance(start) + other.base_distance + i.taxi_distance(other.start))).ToArray());
                }
                else
                {
                    return(new c_intersection[0]);
                }
            }
예제 #2
0
파일: day_03.cs 프로젝트: LEPT0N/toybox
 public c_line_segment(c_vector s, int d, c_vector e)
 {
     start         = s;
     base_distance = d;
     size          = new c_rectangle(s, e);
 }