/
SharedTableRegistry.yaml
86 lines (82 loc) · 2.56 KB
/
SharedTableRegistry.yaml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: SharedTableRegistry
type: class
category:
memory_category: Instances
summary: |
Provides a global registry of named `Datatype.SharedTable` objects.
description: |
Provides a global registry of named `Datatype.SharedTable` objects. It can be
used to store `Datatype.SharedTable` objects that are used by multiple
scripts.
code_samples: []
inherits:
- Instance
tags:
- NotCreatable
- Service
- NotReplicated
deprecation_message: ''
properties: []
methods:
- name: SharedTableRegistry:GetSharedTable
summary: |
Gets the registered `Datatype.SharedTable` with the specified name.
description: |
Gets the registered `Datatype.SharedTable` with the specified name. If no
`Datatype.SharedTable` with that name exists, a new `Datatype.SharedTable`
is created with that name and is returned.
```lua
local SharedTableRegistry = game:GetService("SharedTableRegistry")
local st = SharedTableRegistry:GetSharedTable("MyData")
```
code_samples: []
parameters:
- name: name
type: string
default:
summary: |
The name of the registered `Datatype.SharedTable`.
returns:
- type: SharedTable
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Safe
- name: SharedTableRegistry:SetSharedTable
summary: |
Registers the provided `Datatype.SharedTable` with the specified name.
description: |
Registers the provided `Datatype.SharedTable` with the specified name. If
the provided `Datatype.SharedTable` is `nil`, any existing
`Datatype.SharedTable` with the specified name is unregistered.
```lua
local SharedTableRegistry = game:GetService("SharedTableRegistry")
-- Register a SharedTable with the name "MyData":
local st = SharedTable.new({1, 2, 3})
SharedTableRegistry:SetSharedTable("MyData", st)
-- Unregister the SharedTable with the name "MyData":
SharedTableRegistry:SetSharedTable("MyData", nil)
```
code_samples: []
parameters:
- name: name
type: string
default:
summary: |
The name of the registered `Datatype.SharedTable`.
- name: st
type: SharedTable?
default:
summary: |
The `Datatype.SharedTable` object to register, or `nil` to unregister
any previously registered `Datatype.SharedTable` object.
returns:
- type: void
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Safe
events: []
callbacks: []