fix compiler errors after some changes to game crate

This commit is contained in:
SeanOMik 2024-02-23 16:43:23 -05:00
parent f2d302c6d4
commit 1f43a9d4da
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
3 changed files with 6 additions and 6 deletions

View File

@ -206,7 +206,7 @@ async fn main() {
Ok(()) Ok(())
}; };
let fps_plugin = move |game: &mut Game| { let fps_plugin = move |game: &mut Game| {
let world = game.world(); let world = game.world_mut();
world.add_resource(fps_counter::FPSCounter::new()); world.add_resource(fps_counter::FPSCounter::new());
}; };
@ -228,7 +228,7 @@ async fn main() {
}; };
let jiggle_plugin = move |game: &mut Game| { let jiggle_plugin = move |game: &mut Game| {
game.world().add_resource(TpsAccumulator(0.0)); game.world_mut().add_resource(TpsAccumulator(0.0));
let mut sys = BatchedSystem::new(); let mut sys = BatchedSystem::new();
sys.with_criteria(FixedTimestep::new(45)); sys.with_criteria(FixedTimestep::new(45));
@ -293,7 +293,7 @@ async fn main() {
Ok(()) Ok(())
}; */ }; */
let world = game.world(); let world = game.world_mut();
world.add_resource(action_handler); world.add_resource(action_handler);
world.spawn((Vec3::new(0.5, 0.1, 3.0),)); world.spawn((Vec3::new(0.5, 0.1, 3.0),));
game.with_plugin(InputActionPlugin); game.with_plugin(InputActionPlugin);
@ -303,7 +303,7 @@ async fn main() {
let script_test_plugin = |game: &mut Game| { let script_test_plugin = |game: &mut Game| {
game.with_plugin(LuaScriptingPlugin); game.with_plugin(LuaScriptingPlugin);
let world = game.world(); let world = game.world_mut();
let mut res_man = world.get_resource_mut::<ResourceManager>(); let mut res_man = world.get_resource_mut::<ResourceManager>();
let script = res_man.request::<LuaScript>("scripts/test.lua").unwrap(); let script = res_man.request::<LuaScript>("scripts/test.lua").unwrap();
res_man.watch("scripts/test.lua", false).unwrap(); res_man.watch("scripts/test.lua", false).unwrap();

View File

@ -134,7 +134,7 @@ impl GameScriptExt for Game {
T: ScriptHost, T: ScriptHost,
P: ScriptApiProvider<ScriptContext = T::ScriptContext> + 'static P: ScriptApiProvider<ScriptContext = T::ScriptContext> + 'static
{ {
let world = self.world(); let world = self.world_mut();
provider.prepare_world(world); provider.prepare_world(world);
let mut providers = world.get_resource_mut::<ScriptApiProviders<T>>(); let mut providers = world.get_resource_mut::<ScriptApiProviders<T>>();
providers.add_provider(provider); providers.add_provider(provider);

View File

@ -171,7 +171,7 @@ pub struct LuaScriptingPlugin;
impl Plugin for LuaScriptingPlugin { impl Plugin for LuaScriptingPlugin {
fn setup(&self, game: &mut lyra_game::game::Game) { fn setup(&self, game: &mut lyra_game::game::Game) {
let world = game.world(); let world = game.world_mut();
world.add_resource_default::<TypeRegistry>(); world.add_resource_default::<TypeRegistry>();