Adding a map creation plugin #57

Merged
CoCo_Sol merged 39 commits from map-generation into main 2024-02-21 20:10:03 +00:00
Showing only changes of commit 83c36c704d - Show all commits

View file

@ -235,7 +235,7 @@ impl<T: Number> Iterator for HexSpiral<T> {
impl<T: Number> HexPosition<T> { impl<T: Number> HexPosition<T> {
/// Creates a new [HexPosition]. /// Creates a new [HexPosition].
pub fn new(x: T, y: T) -> Self { pub const fn new(x: T, y: T) -> Self {
Self(x, y) Self(x, y)
} }
@ -262,7 +262,7 @@ impl<T: Number> HexPosition<T> {
size.0 size.0
* 3f32 * 3f32
.sqrt() .sqrt()
.mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.0)), .mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.1)),
size.1 * (3.0 / 2.0 * T::to_f32(self.1)), size.1 * (3.0 / 2.0 * T::to_f32(self.1)),
) )
} }