Services::find_in
This commit is contained in:
parent
317400548d
commit
a88debe9f1
10
src/place.rs
10
src/place.rs
@ -5,6 +5,16 @@ pub struct Services{
|
||||
pub game:Ref,
|
||||
pub workspace:Ref,
|
||||
}
|
||||
impl Services{
|
||||
pub fn find_in(dom:&WeakDom)->Option<Self>{
|
||||
Some(Services{
|
||||
workspace:*dom.root().children().iter().find(|&&r|
|
||||
dom.get_by_ref(r).is_some_and(|instance|instance.class=="Workspace")
|
||||
)?,
|
||||
game:dom.root_ref(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_place_with_instances_in_workspace(mut instance_dom:WeakDom)->(WeakDom,Services){
|
||||
//workspace
|
||||
|
Loading…
Reference in New Issue
Block a user