fix a compile
This commit is contained in:
parent
9fd4ea5bf4
commit
cceff75ba1
1 changed files with 15 additions and 4 deletions
|
@ -14,8 +14,19 @@ pub(super) fn scene_plugin(app: &mut App) {
|
||||||
app.add_systems(Startup, (import_text_world,));
|
app.add_systems(Startup, (import_text_world,));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn import_text_world(mut commands: Commands, assets: Res<AssetServer>) {
|
pub struct WorldInfo {
|
||||||
let world_string = fs::read_to_string("assets/world.txt");
|
block_size: f32,
|
||||||
let &[info_string, world_string] = readf("info section\n{}\nworld section\n{}", world_string);
|
}
|
||||||
println!()
|
|
||||||
|
pub(super) fn import_text_world(mut commands: Commands, assets: Res<AssetServer>) {
|
||||||
|
let world_string = fs::read_to_string("assets/world.txt").expect("need a world to load");
|
||||||
|
let [info_string, world_string] = &readf("info section\n{}\nworld section\n{}", &world_string)
|
||||||
|
.expect("world does not have sections")[..]
|
||||||
|
else {
|
||||||
|
panic!("world does not have sections");
|
||||||
|
};
|
||||||
|
|
||||||
|
for line in info_string.lines() {
|
||||||
|
readf("{} = {}", &line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue