aboutsummaryrefslogtreecommitdiff
path: root/examples/with-3rd-party/ninja.rs
blob: 5b80b3625c0b4722d360a180ce563fff609e8fa8 (plain)
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();
    }
}