Module moonshine_save::save
source · Expand description
Elements related to saving world state.
§Example
use bevy::prelude::*;
use moonshine_save::prelude::*;
#[derive(Component, Default, Reflect)]
#[reflect(Component)]
struct Data(u32);
let mut app = App::new();
app.add_plugins((MinimalPlugins, SavePlugin))
.register_type::<Data>()
.add_systems(PreUpdate, save_default().into_file("example.ron"));
app.world.spawn((Data(12), Save));
app.update();
let data = std::fs::read_to_string("example.ron").unwrap();
Structs§
- A convenient builder for defining a
SavePipeline
with a dynamicSaveFilter
which can be provided from anySystem
. - A convenient builder for defining a
SavePipeline
.
Enums§
- A
SystemSet
for systems that process saving.
Traits§
- Any type which may be used to trigger [
save_into_file_on_request
] or [save_into_file_on_event
].
Functions§
- A
System
which finishes the save process. - Creates a
SavePipelineBuilder
which saves all entities with given entity filterF
. - Creates a
SavePipelineBuilder
which saves all entities unconditionally. - Creates a
DynamicSavePipelineBuilder
which saves all entities unconditionally and a filter sourceS
. - Creates a
SavePipelineBuilder
which saves all entities with aSave
component. - Creates a
DynamicSavePipelineBuilder
which saves all entities with aSave
component and a filter sourceS
. - Creates a
DynamicSavePipelineBuilder
which saves all entities with given entity filterF
and a filter sourceS
.
Type Aliases§
- A collection of systems (
SystemConfigs
) which perform the save process.