generated from tipragot/rust
Add utils for hexagonal grild #50
|
@ -68,6 +68,8 @@ impl HexPosition {
|
|||
///
|
||||
/// ## example
|
||||
/// ```
|
||||
/// use border_wars::hex::HexPosition;
|
||||
///
|
||||
/// let hex1 = HexPosition { q: 0, r: 0 };
|
||||
/// let hex2 = HexPosition { q: 1, r: 1 };
|
||||
/// let distance = hex1.distance_to(&hex2);
|
||||
|
@ -84,6 +86,8 @@ impl HexPosition {
|
|||
///
|
||||
/// ## example
|
||||
/// ```
|
||||
/// use border_wars::hex::HexPosition;
|
||||
///
|
||||
/// let hex = HexPosition { q: 0, r: 0 };
|
||||
/// let positions = hex.range(1);
|
||||
/// assert_eq!(positions.len(), 6);
|
||||
|
|
Loading…
Reference in a new issue