use bfbb::game_interface::{
dolphin::DolphinInterface,
game_var::{GameVar, GameVarMut, InterfaceBackend},
mock::MockInterface,
GameInterface, InterfaceProvider, InterfaceResult,
};
fn main() -> InterfaceResult<()> {
let mut dolphin = DolphinInterface::default();
let mut xemu = MockInterface::default();
println!("Dolphin:");
dolphin.do_with_interface(takes_generic_and_adds_spatulas)?;
println!("Xemu:");
xemu.do_with_interface(takes_generic_and_adds_spatulas)
}
fn takes_generic_and_adds_spatulas<I: InterfaceBackend>(
interface: &mut GameInterface<I>,
) -> InterfaceResult<()> {
let count = interface.spatula_count.get()?;
println!("\tYou have {count} spatulas, adding 10 now",);
interface.spatula_count.set(count + 10)
}