Crate board_game_range

Source
Expand description

§board_game_range

A set of iterators for target ranges in a square tile based board game.

§Supported Range Types

IteratorPattern
Diamond Range⬜⬜🟦⬜⬜
⬜🟦🟦🟦⬜
🟦🟦⬜🟦🟦
⬜🟦🟦🟦⬜
⬜⬜🟦⬜⬜
Square Range⬜⬜⬜⬜⬜
⬜🟦🟦🟦⬜
⬜🟦🟦🟦⬜
⬜🟦🟦🟦⬜
⬜⬜⬜⬜⬜
Cross Range⬜⬜🟦⬜⬜
⬜⬜🟦⬜⬜
🟦🟦🟦🟦🟦
⬜⬜🟦⬜⬜
⬜⬜🟦⬜⬜
Circular Range⬜🟦🟦🟦⬜
🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦
⬜🟦🟦🟦⬜
Rectangle Range⬜⬜⬜⬜⬜
🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦
⬜⬜⬜⬜⬜
Square Frontal⬜🟦🟦🟦⬜
⬜🟦🟦🟦⬜
⬜⬜🟥⬜⬜
⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜
Cone Frontal⬜🟦🟦🟦⬜
⬜⬜🟦⬜⬜
⬜⬜🟥⬜⬜
⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜
Arc Frontal⬜⬜⬜⬜⬜
⬜🟦🟦🟦⬜
⬜🟦🟥🟦⬜
⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜
Line Segment⬜⬜⬜⬜⬜
⬜⬜⬜⬜🟦
⬜⬜🟦🟦⬜
🟦🟦⬜⬜⬜
⬜⬜⬜⬜⬜
Thick Line Segment⬜⬜⬜🟦🟦
⬜⬜🟦🟦🟦
⬜🟦🟦🟦⬜
🟦🟦🟦⬜⬜
🟦🟦⬜⬜⬜

§License

License under either of

Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

§Contribution

Contributions are welcome!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Structs§

CircularRangeIter
CrossRangeIter
DiamondRangeIter
FrontalArcIter
FrontalIter
LineIter
RectangleRangeIter
SquaredRangeIter

Enums§

ArcAngle
Angle in frontal_arc_range.

Functions§

brush_line_range
Move brush from start to end and iterate through points covered by brush
circular_range
Iterate through tiles where their centers are inside a circle based on real distance.
cross_range
Iterate through points in a cross shaped range.
diamond_range
Iterate though points in a diamond shaped range.
frontal_arc_range
Arc or semicircle range around a point.
frontal_rectangle_range
Rectangular frontal range.
frontal_tapered_range
Frontals are ranges created by selecting an adjacent or diagonal tile.
frontal_trapezoid_range
Cone, triangle of trapezoid frontal range.
line_range
Iterate through points on a line segment.
rectangle_range
Iterate though points in a rectangle shaped range.
square_range
Iterate though points in a square shaped range.
thick_line_range
Iterate through points on a thick line segment.