Add utils for hexagonal grild #50

Merged
tipragot merged 23 commits from hex-utils into main 2024-02-14 17:49:08 +00:00
Showing only changes of commit 01c93e13de - Show all commits

View file

@ -106,7 +106,7 @@ impl HexPosition {
/// ///
/// let hex = HexPosition { q: 0, r: 0 }; /// let hex = HexPosition { q: 0, r: 0 };
/// let positions = hex.range(1); /// let positions = hex.range(1);
/// assert_eq!(positions.0.len(), 6); /// assert_eq!(positions.0.len(), 7);
/// ``` /// ```
pub fn range(&self, range: i32) -> GroupHexPosition { pub fn range(&self, range: i32) -> GroupHexPosition {
let mut positions = HashSet::new(); let mut positions = HashSet::new();