Repository navigation
Path
Paths are ordered lists of Points equidistant apart on a Hexmap. They are intended to be used as roads, rivers, trade routes, or other line-like shapes.
The Path raises ValueErrors if one tries adding a point that's the wrong distance from an endpoint.
-
color: what color the path is drawn as
-
vertices: returns a copied list of its vertices.
-
width: double. How wide the path is drawn
-
add_to_end: takes a Point. Adds the point to the path's list of vertices at the end.
-
add_to_start: takes a Point. Adds the point to the path's list of vertices at the start.
-
end: returns the endpoint (Point) of the path. Accepts optional argument, 'offset' (int), to return the point offset the given number from the end.
-init: constructor takes one argument, a Point. This point is the starting point of the path.
-
start: same as method 'end,' but the start.
-
trim_at: takes a Point (or integer) 'where' and an optional bool 'keep_upper'. If 'where' is an integer, the path is cut at that index of its vertices. If 'where' is a Point, and is a vertex, the path is cut at the vertex. The boolean 'keep_upper' specifies that the vertices after 'where' are kept.