generated from tipragot/rust
Add utils for hexagonal grild #50
|
@ -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);
|
||||||
CoCo_Sol marked this conversation as resolved
Outdated
|
|||||||
/// 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();
|
||||||
|
|
Loading…
Reference in a new issue
Don't make a new allocation. Use the += operator