Add utils for hexagonal grild #50

Merged
tipragot merged 23 commits from hex-utils into main 2024-02-14 17:49:08 +00:00
Owner
No description provided.
CoCo_Sol added this to the Gameplay milestone 2024-02-13 19:44:19 +00:00
CoCo_Sol added the
Kind/Feature
label 2024-02-13 19:44:19 +00:00
CoCo_Sol self-assigned this 2024-02-13 19:44:19 +00:00
CoCo_Sol added 2 commits 2024-02-13 19:44:20 +00:00
add hex utils
Some checks failed
Rust Checks / checks (push) Failing after 1m34s
5d0fedac8c
Add num calcules
Some checks failed
Rust Checks / checks (push) Failing after 1m49s
Rust Checks / checks (pull_request) Failing after 1m11s
9af2d354e7
CoCo_Sol added 1 commit 2024-02-13 19:46:12 +00:00
update doc
Some checks failed
Rust Checks / checks (push) Failing after 1m7s
Rust Checks / checks (pull_request) Failing after 1m5s
9a4fb1a5fd
CoCo_Sol changed title from Add utils for hexagonal grild to WIP: Add utils for hexagonal grild 2024-02-13 20:04:01 +00:00
CoCo_Sol added 1 commit 2024-02-13 20:29:37 +00:00
update doc
Some checks failed
Rust Checks / checks (push) Failing after 8m51s
Rust Checks / checks (pull_request) Failing after 10m42s
2ed99e91b2
CoCo_Sol added 1 commit 2024-02-13 21:06:47 +00:00
change doc
Some checks failed
Rust Checks / checks (pull_request) Failing after 24m48s
Rust Checks / checks (push) Failing after 36m2s
01c93e13de
CoCo_Sol added 3 commits 2024-02-14 00:59:24 +00:00
WIP: Add docs
Some checks failed
Rust Checks / checks (push) Failing after 6s
Rust Checks / checks (pull_request) Failing after 4s
23d839ea34
CoCo_Sol added 1 commit 2024-02-14 09:44:46 +00:00
Add exemple
Some checks failed
Rust Checks / checks (push) Failing after 19s
Rust Checks / checks (pull_request) Failing after 4s
471f516150
CoCo_Sol added 1 commit 2024-02-14 09:46:41 +00:00
fix fmt
Some checks failed
Rust Checks / checks (push) Failing after 5s
Rust Checks / checks (pull_request) Failing after 5s
b6f7a202b4
CoCo_Sol added 1 commit 2024-02-14 09:51:38 +00:00
Fix clippy
Some checks failed
Rust Checks / checks (push) Failing after 5s
Rust Checks / checks (pull_request) Failing after 5s
4da153b626
CoCo_Sol added 1 commit 2024-02-14 09:53:38 +00:00
fix fmt
Some checks failed
Rust Checks / checks (push) Failing after 3m12s
Rust Checks / checks (pull_request) Failing after 1m36s
d44db4fa3e
CoCo_Sol added 1 commit 2024-02-14 09:58:55 +00:00
fix test
All checks were successful
Rust Checks / checks (pull_request) Successful in 4m49s
Rust Checks / checks (push) Successful in 1m24s
ff1a6d6ab4
CoCo_Sol added 1 commit 2024-02-14 10:15:50 +00:00
better doc
Some checks failed
Rust Checks / checks (push) Has been cancelled
Rust Checks / checks (pull_request) Has been cancelled
1f0083bba8
CoCo_Sol added 1 commit 2024-02-14 10:18:10 +00:00
add no run to exemple
All checks were successful
Rust Checks / checks (push) Successful in 1m18s
Rust Checks / checks (pull_request) Successful in 2m11s
cfb3de298e
CoCo_Sol requested review from tipragot 2024-02-14 10:21:55 +00:00
CoCo_Sol changed title from WIP: Add utils for hexagonal grild to Add utils for hexagonal grild 2024-02-14 10:22:56 +00:00
tipragot requested changes 2024-02-14 11:51:50 +00:00
@ -0,0 +13,4 @@
/// R coordinate
pub r: i32,
}
Contributor

I think we should be more generic over the type used. You can use the num crate to do so. And you could still make a specific type using the type keyword.

I think we should be more generic over the type used. You can use the [num](https://crates.io/crates/num) crate to do so. And you could still make a specific type using the `type` keyword.
CoCo_Sol marked this conversation as resolved
CoCo_Sol added 1 commit 2024-02-14 13:37:30 +00:00
add generique type
Some checks failed
Rust Checks / checks (push) Failing after 5m18s
Rust Checks / checks (pull_request) Failing after 1m26s
8590c94973
CoCo_Sol added 1 commit 2024-02-14 13:46:29 +00:00
update test
All checks were successful
Rust Checks / checks (push) Successful in 2m35s
Rust Checks / checks (pull_request) Successful in 1m13s
b6587abea1
CoCo_Sol requested review from tipragot 2024-02-14 13:52:25 +00:00
CoCo_Sol added 1 commit 2024-02-14 14:26:58 +00:00
change min and max
All checks were successful
Rust Checks / checks (push) Successful in 1m14s
Rust Checks / checks (pull_request) Successful in 1m14s
f95f63ffd1
CoCo_Sol added 3 commits 2024-02-14 16:35:44 +00:00
update
Some checks failed
Rust Checks / checks (push) Failing after 22s
Rust Checks / checks (pull_request) Failing after 20s
4c08cd83c4
tipragot requested changes 2024-02-14 16:35:45 +00:00
@ -0,0 +53,4 @@
let dr = self.r - other.r;
// dz = |z1 - z2| where z = -q - r
let dz = self.q + self.r - other.q - other.r;
Contributor

dz = -dq - dr

dz = -dq - dr
CoCo_Sol marked this conversation as resolved
@ -0,0 +105,4 @@
impl<T: HexNumber> ops::AddAssign<Self> for HexPosition<T> {
fn add_assign(&mut self, other: Self) {
*self = *self + other;
Contributor

Don't make a new allocation. Use the += operator

Don't make a new allocation. Use the += operator
CoCo_Sol marked this conversation as resolved
@ -0,0 +122,4 @@
impl<T: HexNumber> ops::SubAssign<Self> for HexPosition<T> {
fn sub_assign(&mut self, other: Self) {
*self = *self - other;
Contributor

Don't make a new allocation. Use the += operator

Don't make a new allocation. Use the += operator
CoCo_Sol marked this conversation as resolved
CoCo_Sol added 1 commit 2024-02-14 17:41:56 +00:00
Change num methode
All checks were successful
Rust Checks / checks (push) Successful in 1m32s
Rust Checks / checks (pull_request) Successful in 1m54s
b04ed1acf4
CoCo_Sol requested review from tipragot 2024-02-14 17:43:58 +00:00
CoCo_Sol added 1 commit 2024-02-14 17:45:17 +00:00
add \n
All checks were successful
Rust Checks / checks (push) Successful in 1m23s
Rust Checks / checks (pull_request) Successful in 1m16s
0736a2381d
tipragot approved these changes 2024-02-14 17:47:35 +00:00
tipragot merged commit 5719e278a2 into main 2024-02-14 17:49:07 +00:00
tipragot referenced this pull request from a commit 2024-02-14 17:49:08 +00:00
tipragot deleted branch hex-utils 2024-02-14 17:49:10 +00:00
Sign in to join this conversation.
No description provided.