1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use syrette::{injectable, ptr::TransientPtr}; use third_party_lib::Shuriken; use crate::interfaces::ninja::INinja; pub struct Ninja { shuriken: TransientPtr<Shuriken>, } #[injectable(INinja)] impl Ninja { pub fn new(shuriken: TransientPtr<Shuriken>) -> Self { Self { shuriken } } } impl INinja for Ninja { fn throw_shuriken(&self) { self.shuriken.throw(); } }