Class Line

java.lang.Object
games.stendhal.common.Line

public class Line extends Object
a line consisting of points
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    callback which is invoked for each point
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<Point>
    renderLine​(int x1, int y1, int x2, int y2)
    renders a line from (x1, y2) to (x2, y2)
    static void
    renderLine​(int x1, int y1, int x2, int y2, Line.Action action)
    renders a line from (x1, y2) to (x2, y2)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Line

      public Line()
  • Method Details

    • renderLine

      public static List<Point> renderLine(int x1, int y1, int x2, int y2)
      renders a line from (x1, y2) to (x2, y2)
      Parameters:
      x1 - x-coordinate of start point
      y1 - y-coordinate of start point
      x2 - x-coordinate of end point
      y2 - y-coordinate of end point
      Returns:
      vector of points
    • renderLine

      public static void renderLine(int x1, int y1, int x2, int y2, Line.Action action)
      renders a line from (x1, y2) to (x2, y2)
      Parameters:
      x1 - x-coordinate of start point
      y1 - y-coordinate of start point
      x2 - x-coordinate of end point
      y2 - y-coordinate of end point
      action - callback to call for each point