Skip to content

Commit a4d1ffb

Browse files
authored
update docs (#371)
# Summary - updates docs to replace references of `get_type_by_name` in prominent places
1 parent 85e0ae6 commit a4d1ffb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/src/ScriptingReference/constructing-arbitrary-types.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct MyStruct {
1717

1818
can be constructed from lua like so:
1919
```lua
20-
local MyStruct = world.get_type_by_name("MyStruct")
20+
local MyStruct = types.MyStruct
2121
local concrete_my_struct = construct(MyStruct, {
2222
my_field = "hello"
2323
})
@@ -33,7 +33,7 @@ pub struct MyTupleStruct(pub String);
3333
can be constructed like so:
3434
```lua
3535

36-
local MyTupleStruct = world.get_type_by_name("MyTupleStruct")
36+
local MyTupleStruct = types.MyTupleStruct
3737
local concrete_my_tuple_struct = construct(MyTupleStruct, {
3838
_1 = "hello"
3939
})
@@ -53,7 +53,7 @@ pub enum MyEnum {
5353
can be constructed like so:
5454
```lua
5555

56-
local MyEnum = world.get_type_by_name("MyEnum")
56+
local MyEnum = types.MyEnum
5757
local variantA = construct(MyEnum, {
5858
variant = "VariantA",
5959
field = "hello"

docs/src/ScriptingReference/world.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ MyType = world.get_type_by_name("MyType")
2323
if MyType == nil then
2424
print("MyType not found")
2525
end
26+
27+
-- OR
28+
MyType = types.MyType
2629
```
2730

2831
### get_component

0 commit comments

Comments
 (0)