game.workspace

This commit is contained in:
Quaternions 2024-10-04 19:04:54 -07:00
parent 67223efa26
commit 96c8b1035a

View File

@ -298,6 +298,13 @@ class!(DataModel);
class_composition!(DataModel,(Instance,DataModel)); class_composition!(DataModel,(Instance,DataModel));
impl DataModel{ impl DataModel{
fn composition_add_fields<'lua,T:Referent,F:mlua::UserDataFields<'lua,T>>(fields:&mut F){ fn composition_add_fields<'lua,T:Referent,F:mlua::UserDataFields<'lua,T>>(fields:&mut F){
fields.add_field_method_get("workspace",|lua,this|{
dom(lua,|dom|{
Ok(find_first_child_of_class(dom,this.get(dom)?,"Workspace")
.map(|inst|Workspace::new(inst.referent()))
)
})
});
fields.add_field_method_get("PlaceId",|lua,this|{ fields.add_field_method_get("PlaceId",|lua,this|{
Ok(mlua::Value::Integer(0)) Ok(mlua::Value::Integer(0))
}); });