Implement very basic and bad and specific netcode
All checks were successful
CI / Formatting (push) Successful in 1m14s

The game can now retrieve its seed from another game on the network
This commit is contained in:
Michael Bradley 2025-05-25 00:54:16 -04:00
parent 50ef78f7aa
commit dad37262a5
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
7 changed files with 116 additions and 5 deletions

View file

@ -8,6 +8,7 @@ use rand::random;
pub struct Seed(u64);
impl Seed {
/// Use a random integer as the seed
pub fn random() -> Self {
Self(random())
}
@ -30,3 +31,15 @@ impl From<Seed> for [u8; 8] {
value.0.to_le_bytes()
}
}
impl From<u64> for Seed {
fn from(value: u64) -> Self {
Seed(value)
}
}
impl From<Seed> for u64 {
fn from(value: Seed) -> Self {
value.0
}
}