use log::info; use crate::{LUA, MODULE_NAME, PLUGIN_NAME, global, lua}; pub(crate) struct Plugin {} impl Plugin { pub fn new() -> Self { Self {} } pub fn setup_game(&self) { info!("[setup_game] Hello, world! This is {}!", PLUGIN_NAME); let lua = global!(LUA); lua.add_module_function(MODULE_NAME, "do_something", lua::do_something); } pub fn shutdown_game(&self) { info!("[shutdown_game] Goodbye, world!"); } pub fn update_game(&self, _dt: f32) {} } impl std::fmt::Debug for Plugin { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("PluginApi") } }