Extract systems

This commit is contained in:
Michael Bradley 2025-05-19 00:27:12 -04:00
parent cef21f4a00
commit 214e0ceedc
Signed by: MichaelBradley
SSH key fingerprint: SHA256:BKO2eI2LPsCbQS3n3i5SdwZTAIV3F1lHezR07qP+Ob0
9 changed files with 199 additions and 191 deletions

View file

@ -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()
}
}