Extract systems
This commit is contained in:
parent
cef21f4a00
commit
214e0ceedc
9 changed files with 199 additions and 191 deletions
|
@ -1,22 +0,0 @@
|
|||
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Clone, Resource)]
|
||||
pub struct Seed(u64);
|
||||
|
||||
impl From<String> for Seed {
|
||||
fn from(value: String) -> Self {
|
||||
Self(value.parse::<u64>().unwrap_or_else(|_| {
|
||||
let mut state = DefaultHasher::new();
|
||||
value.hash(&mut state);
|
||||
state.finish()
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Seed> for [u8; 8] {
|
||||
fn from(value: Seed) -> Self {
|
||||
value.0.to_le_bytes()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue