Module utils

Module utils 

Source
Expand description

§Utility functions.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Structs§

HexBound
The HexBound struct defines a hexagonal area centered around a specific hexagonal position. This struct encapsulates a central position (HexPosition<T>) and a radius (usize). It allows checking whether a given position is within this hexagonal area.

Functions§

axial_round
An utility function for axial round. for more information, see the documentation.
clamp
An utility function for clamp. for more information, see the documentation.
hexagonal_lerp
An utility function for lerp between two hexagonal positions. for more information, see the documentation.
lerp
An utility function for linear interpolation. for more information, see the documentation.
neighbors
An utility function for getting the neighbors of a hexagonal position. for more information, see the documentation.