board_game_range/
lib.rs

1#![doc = include_str!("../README.md")]
2mod arc;
3mod circular;
4mod cross;
5mod diamond;
6mod frontal;
7mod line;
8mod rectangle;
9mod square;
10
11#[derive(Debug, Clone, Copy)]
12#[repr(u32)]
13enum Dir {
14    A = 0,
15    B = 1,
16    C = 2,
17    D = 3,
18}
19
20impl Dir {
21    fn increment(&mut self) {
22        match self {
23            Dir::A => *self = Dir::B,
24            Dir::B => *self = Dir::C,
25            Dir::C => *self = Dir::D,
26            Dir::D => *self = Dir::A,
27        }
28    }
29}
30
31fn add(this: &mut [i32; 2], other: [i32; 2]) {
32    this[0] += other[0];
33    this[1] += other[1];
34}
35
36pub use arc::{frontal_arc_range, ArcAngle, FrontalArcIter};
37pub use circular::{circular_range, CircularRangeIter};
38pub use cross::{cross_range, CrossRangeIter};
39pub use diamond::{diamond_range, DiamondRangeIter};
40pub use frontal::{
41    frontal_rectangle_range, frontal_tapered_range, frontal_trapezoid_range, FrontalIter,
42};
43pub use line::{brush_line_range, line_range, thick_line_range, LineIter};
44pub use rectangle::{rectangle_range, RectangleRangeIter};
45pub use square::{square_range, SquaredRangeIter};