Module caniseeu

Source
Expand description

An algorithm to determine if the line of sight between two coordinates on a board is blocked or not.

§Usage

Use Board::is_line_of_sight_blocked.

§Details

Assumes that (0, 0) is the bottom left corner, and (x, y) is x units to the right and y units up. NOTE: In the network standard, (y, x) is (usually?) used instead of (x, y).

Functions§

is_line_of_sight_blocked
is_line_of_sight_blocked_right_slightly_up 🔒
Works for line of sights from (0, 0) to (to.x, to.y), where to.y <= to.x (angles between 0 and 45°). Assumes (0, 0) and (to.x, to.y) are non-rock tiles.
is_line_of_sight_blocked_right_up 🔒