aboutsummaryrefslogtreecommitdiff
path: root/examples/with-3rd-party/ninja.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/with-3rd-party/ninja.rs')
-rw-r--r--examples/with-3rd-party/ninja.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/with-3rd-party/ninja.rs b/examples/with-3rd-party/ninja.rs
new file mode 100644
index 0000000..945adf0
--- /dev/null
+++ b/examples/with-3rd-party/ninja.rs
@@ -0,0 +1,26 @@
+use syrette::{injectable, ptr::TransientPtr};
+use third_party_lib::IShuriken;
+
+use crate::interfaces::ninja::INinja;
+
+pub struct Ninja
+{
+ shuriken: TransientPtr<dyn IShuriken>,
+}
+
+#[injectable(INinja)]
+impl Ninja
+{
+ pub fn new(shuriken: TransientPtr<dyn IShuriken>) -> Self
+ {
+ Self { shuriken }
+ }
+}
+
+impl INinja for Ninja
+{
+ fn throw_shuriken(&self)
+ {
+ self.shuriken.throw();
+ }
+}