Implement very basic and bad and specific netcode
All checks were successful
CI / Formatting (push) Successful in 1m14s
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:
parent
50ef78f7aa
commit
dad37262a5
7 changed files with 116 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue