1
- use std:: { ops:: Deref , rc :: Rc } ;
1
+ use std:: ops:: Deref ;
2
2
3
3
use abi_stable:: std_types:: RBox ;
4
4
use godot:: {
5
- obj:: EngineEnum ,
5
+ obj:: { EngineBitfield , EngineEnum } ,
6
6
prelude:: {
7
7
meta:: { ClassName , MethodInfo , PropertyInfo } ,
8
8
Array , Dictionary , Gd , Object , StringName , ToGodot ,
@@ -12,17 +12,18 @@ use godot::{
12
12
13
13
use crate :: {
14
14
apply:: Apply ,
15
- script_registry:: { CreateScriptInstanceData_TO , RemoteGodotScript_TO , RemoteScriptMetaData } ,
15
+ script_registry:: {
16
+ CreateScriptInstanceData_TO , RemoteGodotScript_TO , RemoteScriptMetaData ,
17
+ RemoteScriptMethodInfo , RemoteScriptPropertyInfo ,
18
+ } ,
16
19
} ;
17
20
18
21
#[ derive( Debug ) ]
19
22
pub struct ScriptMetaData {
20
23
class_name : ClassName ,
21
24
base_type_name : StringName ,
22
- properties_documented : Vec < Documented < PropertyInfo > > ,
23
- properties : Rc < Vec < PropertyInfo > > ,
24
- methods_documented : Vec < Documented < MethodInfo > > ,
25
- methods : Rc < Vec < MethodInfo > > ,
25
+ properties : Vec < RemoteScriptPropertyInfo > ,
26
+ methods : Vec < RemoteScriptMethodInfo > ,
26
27
create_data : CreateScriptInstanceData_TO < ' static , RBox < ( ) > > ,
27
28
description : & ' static str ,
28
29
}
@@ -40,20 +41,12 @@ impl ScriptMetaData {
40
41
self . create_data . create ( base. to_variant ( ) . into ( ) )
41
42
}
42
43
43
- pub fn properties ( & self ) -> Rc < Vec < PropertyInfo > > {
44
- self . properties . clone ( )
45
- }
46
-
47
- pub fn properties_documented ( & self ) -> & [ Documented < PropertyInfo > ] {
48
- & self . properties_documented
49
- }
50
-
51
- pub fn methods ( & self ) -> Rc < Vec < MethodInfo > > {
52
- self . methods . clone ( )
44
+ pub fn properties ( & self ) -> & [ RemoteScriptPropertyInfo ] {
45
+ & self . properties
53
46
}
54
47
55
- pub fn methods_documented ( & self ) -> & [ Documented < MethodInfo > ] {
56
- & self . methods_documented
48
+ pub fn methods ( & self ) -> & [ RemoteScriptMethodInfo ] {
49
+ & self . methods
57
50
}
58
51
59
52
pub fn description ( & self ) -> & ' static str {
@@ -66,15 +59,8 @@ impl From<RemoteScriptMetaData> for ScriptMetaData {
66
59
Self {
67
60
class_name : ClassName :: from_ascii_cstr ( value. class_name . as_str ( ) . as_bytes ( ) ) ,
68
61
base_type_name : StringName :: from ( & value. base_type_name . as_str ( ) ) ,
69
- properties_documented : value
70
- . properties
71
- . clone ( )
72
- . into_iter ( )
73
- . map ( Into :: into)
74
- . collect ( ) ,
75
- properties : Rc :: new ( value. properties . into_iter ( ) . map ( Into :: into) . collect ( ) ) ,
76
- methods_documented : value. methods . clone ( ) . into_iter ( ) . map ( Into :: into) . collect ( ) ,
77
- methods : Rc :: new ( value. methods . into_iter ( ) . map ( Into :: into) . collect ( ) ) ,
62
+ properties : value. properties . to_vec ( ) ,
63
+ methods : value. methods . to_vec ( ) ,
78
64
create_data : value. create_data ,
79
65
description : value. description . as_str ( ) ,
80
66
}
0 commit comments