From 01b43deb6ed5ce1a82f2970375ca6ddf06d98229 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Thu, 10 May 2007 22:00:24 +0000 Subject: [PATCH] Line -> LineSegment git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4707 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/util/{Line.as => LineSegment.as} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename src/as/com/threerings/util/{Line.as => LineSegment.as} (90%) diff --git a/src/as/com/threerings/util/Line.as b/src/as/com/threerings/util/LineSegment.as similarity index 90% rename from src/as/com/threerings/util/Line.as rename to src/as/com/threerings/util/LineSegment.as index 333a33f67..55a40fc43 100644 --- a/src/as/com/threerings/util/Line.as +++ b/src/as/com/threerings/util/LineSegment.as @@ -27,7 +27,7 @@ import flash.geom.Matrix; /** * Merely a typed container for two Points. */ -public class Line implements Equalable +public class LineSegment implements Equalable { public static const INTERSECTION_NORTH :int = 1; public static const INTERSECTION_SOUTH :int = 2; @@ -36,7 +36,7 @@ public class Line implements Equalable public var start :Point; public var stop :Point; - public function Line (start :Point, stop :Point) + public function LineSegment (start :Point, stop :Point) { this.start = start; this.stop = stop; @@ -50,7 +50,7 @@ public class Line implements Equalable return Point.distance(start, stop); } - public function isIntersected (line :Line) :Boolean + public function isIntersected (line :LineSegment) :Boolean { return getIntersectionType(line) != DOES_NOT_INTERSECT; } @@ -58,7 +58,7 @@ public class Line implements Equalable /** * Return the point at which the other line intersects us. */ - public function getIntersectionPoint (line :Line) :Point + public function getIntersectionPoint (line :LineSegment) :Point { return getIntersection(line, true) as Point; } @@ -72,7 +72,7 @@ public class Line implements Equalable * Intersections are inclusive. If one or both points lands on this line, interects will not * return DOES_NOT_INTERSECT. */ - public function getIntersectionType (line :Line) :int + public function getIntersectionType (line :LineSegment) :int { return getIntersection(line, false) as int; } @@ -80,7 +80,7 @@ public class Line implements Equalable // from interface Equalable public function equals (o :Object) :Boolean { - var other :Line = o as Line; // or null if not a line + var other :LineSegment = o as LineSegment; // or null if not a line if (other == null) { return false; } @@ -94,7 +94,7 @@ public class Line implements Equalable * and returns either the intersected point or merely the intersection * type. */ - protected function getIntersection (line :Line, returnPoint :Boolean) :* + protected function getIntersection (line :LineSegment, returnPoint :Boolean) :* { // rotate so that this line is horizontal, with the start on the left, at (0, 0) var trans :Matrix = new Matrix();