roblox-opencode 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -0
- package/commands/setup-game.md +108 -0
- package/commands/sync-check.md +53 -0
- package/core/roblox-core.md +93 -0
- package/dist/server.js +167 -0
- package/package.json +35 -0
- package/skills/roblox-analytics/SKILL.md +277 -0
- package/skills/roblox-analytics/references/event-batcher.luau +75 -0
- package/skills/roblox-animation-vfx/SKILL.md +1325 -0
- package/skills/roblox-architecture/SKILL.md +863 -0
- package/skills/roblox-architecture/references/combat-systems.md +1381 -0
- package/skills/roblox-code-review/SKILL.md +687 -0
- package/skills/roblox-data/SKILL.md +889 -0
- package/skills/roblox-data/references/inventory-systems.md +1729 -0
- package/skills/roblox-debug/SKILL.md +99 -0
- package/skills/roblox-gui/SKILL.md +1103 -0
- package/skills/roblox-gui-fusion/SKILL.md +150 -0
- package/skills/roblox-gui-fusion/references/inventory.luau +427 -0
- package/skills/roblox-gui-fusion/references/settings-menu.luau +579 -0
- package/skills/roblox-gui-fusion/references/shop.luau +411 -0
- package/skills/roblox-luau-mastery/SKILL.md +1519 -0
- package/skills/roblox-monetization/SKILL.md +1084 -0
- package/skills/roblox-monetization/references/process-receipt.luau +131 -0
- package/skills/roblox-networking/SKILL.md +669 -0
- package/skills/roblox-networking/references/remote-validator.luau +193 -0
- package/skills/roblox-publish-checklist/SKILL.md +128 -0
- package/skills/roblox-runtime/SKILL.md +753 -0
- package/skills/roblox-sharp-edges/SKILL.md +295 -0
- package/skills/roblox-sync/SKILL.md +126 -0
- package/skills/roblox-testing/SKILL.md +943 -0
- package/skills/roblox-tooling/SKILL.md +150 -0
- package/vendor/LICENSES/ProfileStore-LICENSE +201 -0
- package/vendor/LICENSES/RbxUtil-LICENSE +7 -0
- package/vendor/LICENSES/promise-LICENSE +21 -0
- package/vendor/LICENSES/t-LICENSE +21 -0
- package/vendor/LICENSES/testez-LICENSE +201 -0
- package/vendor/README.md +84 -0
- package/vendor/fusion/Animation/ExternalTime.luau +84 -0
- package/vendor/fusion/Animation/Spring.luau +322 -0
- package/vendor/fusion/Animation/Stopwatch.luau +128 -0
- package/vendor/fusion/Animation/Tween.luau +187 -0
- package/vendor/fusion/Animation/getTweenDuration.luau +27 -0
- package/vendor/fusion/Animation/getTweenRatio.luau +47 -0
- package/vendor/fusion/Animation/lerpType.luau +164 -0
- package/vendor/fusion/Animation/packType.luau +100 -0
- package/vendor/fusion/Animation/springCoefficients.luau +80 -0
- package/vendor/fusion/Animation/unpackType.luau +103 -0
- package/vendor/fusion/Colour/Oklab.luau +70 -0
- package/vendor/fusion/Colour/sRGB.luau +55 -0
- package/vendor/fusion/External.luau +168 -0
- package/vendor/fusion/ExternalDebug.luau +70 -0
- package/vendor/fusion/Graph/Observer.luau +114 -0
- package/vendor/fusion/Graph/castToGraph.luau +29 -0
- package/vendor/fusion/Graph/change.luau +81 -0
- package/vendor/fusion/Graph/depend.luau +33 -0
- package/vendor/fusion/Graph/evaluate.luau +56 -0
- package/vendor/fusion/Instances/Attribute.luau +58 -0
- package/vendor/fusion/Instances/AttributeChange.luau +47 -0
- package/vendor/fusion/Instances/AttributeOut.luau +63 -0
- package/vendor/fusion/Instances/Child.luau +21 -0
- package/vendor/fusion/Instances/Children.luau +148 -0
- package/vendor/fusion/Instances/Hydrate.luau +33 -0
- package/vendor/fusion/Instances/New.luau +53 -0
- package/vendor/fusion/Instances/OnChange.luau +50 -0
- package/vendor/fusion/Instances/OnEvent.luau +54 -0
- package/vendor/fusion/Instances/Out.luau +69 -0
- package/vendor/fusion/Instances/applyInstanceProps.luau +149 -0
- package/vendor/fusion/Instances/defaultProps.luau +194 -0
- package/vendor/fusion/LICENSE +21 -0
- package/vendor/fusion/Logging/formatError.luau +49 -0
- package/vendor/fusion/Logging/messages.luau +52 -0
- package/vendor/fusion/Logging/parseError.luau +25 -0
- package/vendor/fusion/Memory/checkLifetime.luau +134 -0
- package/vendor/fusion/Memory/deriveScope.luau +24 -0
- package/vendor/fusion/Memory/deriveScopeImpl.luau +45 -0
- package/vendor/fusion/Memory/doCleanup.luau +79 -0
- package/vendor/fusion/Memory/innerScope.luau +34 -0
- package/vendor/fusion/Memory/legacyCleanup.luau +18 -0
- package/vendor/fusion/Memory/needsDestruction.luau +17 -0
- package/vendor/fusion/Memory/poisonScope.luau +34 -0
- package/vendor/fusion/Memory/scopePool.luau +55 -0
- package/vendor/fusion/Memory/scoped.luau +27 -0
- package/vendor/fusion/Memory/whichLivesLonger.luau +75 -0
- package/vendor/fusion/RobloxExternal.luau +98 -0
- package/vendor/fusion/State/Computed.luau +139 -0
- package/vendor/fusion/State/For/Disassembly.luau +211 -0
- package/vendor/fusion/State/For/ForTypes.luau +30 -0
- package/vendor/fusion/State/For/init.luau +110 -0
- package/vendor/fusion/State/ForKeys.luau +94 -0
- package/vendor/fusion/State/ForPairs.luau +97 -0
- package/vendor/fusion/State/ForValues.luau +94 -0
- package/vendor/fusion/State/Value.luau +88 -0
- package/vendor/fusion/State/castToState.luau +26 -0
- package/vendor/fusion/State/peek.luau +31 -0
- package/vendor/fusion/State/updateAll.luau +1 -0
- package/vendor/fusion/Types.luau +314 -0
- package/vendor/fusion/Utility/Contextual.luau +91 -0
- package/vendor/fusion/Utility/Safe.luau +23 -0
- package/vendor/fusion/Utility/isSimilar.luau +29 -0
- package/vendor/fusion/Utility/merge.luau +35 -0
- package/vendor/fusion/Utility/nameOf.luau +35 -0
- package/vendor/fusion/Utility/never.luau +14 -0
- package/vendor/fusion/Utility/nicknames.luau +11 -0
- package/vendor/fusion/Utility/xtypeof.luau +27 -0
- package/vendor/fusion/init.luau +82 -0
- package/vendor/profilestore/init.luau +2243 -0
- package/vendor/promise/init.luau +1982 -0
- package/vendor/rbxutil/buffer-util/Buffer.test.luau +25 -0
- package/vendor/rbxutil/buffer-util/BufferReader.luau +228 -0
- package/vendor/rbxutil/buffer-util/BufferWriter.luau +269 -0
- package/vendor/rbxutil/buffer-util/DataTypeBuffer.luau +223 -0
- package/vendor/rbxutil/buffer-util/Types.luau +60 -0
- package/vendor/rbxutil/buffer-util/index.d.ts +153 -0
- package/vendor/rbxutil/buffer-util/init.luau +41 -0
- package/vendor/rbxutil/buffer-util/package.json +16 -0
- package/vendor/rbxutil/buffer-util/wally.toml +9 -0
- package/vendor/rbxutil/comm/Client/ClientComm.luau +232 -0
- package/vendor/rbxutil/comm/Client/ClientRemoteProperty.luau +156 -0
- package/vendor/rbxutil/comm/Client/ClientRemoteSignal.luau +109 -0
- package/vendor/rbxutil/comm/Client/init.luau +135 -0
- package/vendor/rbxutil/comm/Server/RemoteProperty.luau +295 -0
- package/vendor/rbxutil/comm/Server/RemoteSignal.luau +211 -0
- package/vendor/rbxutil/comm/Server/ServerComm.luau +211 -0
- package/vendor/rbxutil/comm/Server/init.luau +140 -0
- package/vendor/rbxutil/comm/Types.luau +18 -0
- package/vendor/rbxutil/comm/Util.luau +27 -0
- package/vendor/rbxutil/comm/init.luau +35 -0
- package/vendor/rbxutil/comm/wally.toml +13 -0
- package/vendor/rbxutil/component/init.luau +759 -0
- package/vendor/rbxutil/component/init.test.luau +311 -0
- package/vendor/rbxutil/component/wally.toml +14 -0
- package/vendor/rbxutil/concur/init.luau +542 -0
- package/vendor/rbxutil/concur/init.test.luau +364 -0
- package/vendor/rbxutil/concur/wally.toml +8 -0
- package/vendor/rbxutil/enum-list/init.luau +101 -0
- package/vendor/rbxutil/enum-list/init.test.luau +91 -0
- package/vendor/rbxutil/enum-list/wally.toml +8 -0
- package/vendor/rbxutil/find/index.d.ts +20 -0
- package/vendor/rbxutil/find/init.luau +44 -0
- package/vendor/rbxutil/find/package.json +17 -0
- package/vendor/rbxutil/find/wally.toml +8 -0
- package/vendor/rbxutil/input/Gamepad.luau +559 -0
- package/vendor/rbxutil/input/Keyboard.luau +124 -0
- package/vendor/rbxutil/input/Mouse.luau +278 -0
- package/vendor/rbxutil/input/PreferredInput.luau +91 -0
- package/vendor/rbxutil/input/Touch.luau +120 -0
- package/vendor/rbxutil/input/init.luau +33 -0
- package/vendor/rbxutil/input/wally.toml +12 -0
- package/vendor/rbxutil/loader/index.d.ts +15 -0
- package/vendor/rbxutil/loader/init.luau +137 -0
- package/vendor/rbxutil/loader/wally.toml +8 -0
- package/vendor/rbxutil/log/index.d.ts +38 -0
- package/vendor/rbxutil/log/init.luau +746 -0
- package/vendor/rbxutil/log/wally.toml +8 -0
- package/vendor/rbxutil/net/init.luau +190 -0
- package/vendor/rbxutil/net/wally.toml +8 -0
- package/vendor/rbxutil/option/index.d.ts +44 -0
- package/vendor/rbxutil/option/init.luau +489 -0
- package/vendor/rbxutil/option/init.test.luau +342 -0
- package/vendor/rbxutil/option/wally.toml +8 -0
- package/vendor/rbxutil/pid/index.d.ts +53 -0
- package/vendor/rbxutil/pid/init.luau +195 -0
- package/vendor/rbxutil/pid/package.json +16 -0
- package/vendor/rbxutil/pid/wally.toml +9 -0
- package/vendor/rbxutil/quaternion/index.d.ts +117 -0
- package/vendor/rbxutil/quaternion/init.luau +570 -0
- package/vendor/rbxutil/quaternion/package.json +16 -0
- package/vendor/rbxutil/quaternion/wally.toml +9 -0
- package/vendor/rbxutil/query/index.d.ts +43 -0
- package/vendor/rbxutil/query/init.luau +117 -0
- package/vendor/rbxutil/query/package.json +18 -0
- package/vendor/rbxutil/query/wally.toml +9 -0
- package/vendor/rbxutil/sequent/index.d.ts +28 -0
- package/vendor/rbxutil/sequent/init.luau +340 -0
- package/vendor/rbxutil/sequent/package.json +16 -0
- package/vendor/rbxutil/sequent/wally.toml +9 -0
- package/vendor/rbxutil/ser/init.luau +175 -0
- package/vendor/rbxutil/ser/init.test.luau +50 -0
- package/vendor/rbxutil/ser/wally.toml +11 -0
- package/vendor/rbxutil/shake/index.d.ts +36 -0
- package/vendor/rbxutil/shake/init.luau +532 -0
- package/vendor/rbxutil/shake/init.test.luau +267 -0
- package/vendor/rbxutil/shake/package.json +16 -0
- package/vendor/rbxutil/shake/wally.toml +9 -0
- package/vendor/rbxutil/signal/index.d.ts +100 -0
- package/vendor/rbxutil/signal/init.luau +432 -0
- package/vendor/rbxutil/signal/init.test.luau +190 -0
- package/vendor/rbxutil/signal/package.json +17 -0
- package/vendor/rbxutil/signal/wally.toml +9 -0
- package/vendor/rbxutil/silo/TableWatcher.luau +65 -0
- package/vendor/rbxutil/silo/Util.luau +55 -0
- package/vendor/rbxutil/silo/init.luau +338 -0
- package/vendor/rbxutil/silo/init.test.luau +215 -0
- package/vendor/rbxutil/silo/wally.toml +8 -0
- package/vendor/rbxutil/spring/index.d.ts +40 -0
- package/vendor/rbxutil/spring/init.luau +97 -0
- package/vendor/rbxutil/spring/package.json +17 -0
- package/vendor/rbxutil/spring/wally.toml +8 -0
- package/vendor/rbxutil/stream/index.d.ts +88 -0
- package/vendor/rbxutil/stream/init.luau +597 -0
- package/vendor/rbxutil/stream/package.json +18 -0
- package/vendor/rbxutil/stream/wally.toml +9 -0
- package/vendor/rbxutil/streamable/Streamable.luau +202 -0
- package/vendor/rbxutil/streamable/StreamableUtil.luau +80 -0
- package/vendor/rbxutil/streamable/init.luau +8 -0
- package/vendor/rbxutil/streamable/wally.toml +12 -0
- package/vendor/rbxutil/symbol/init.luau +56 -0
- package/vendor/rbxutil/symbol/init.test.luau +37 -0
- package/vendor/rbxutil/symbol/wally.toml +8 -0
- package/vendor/rbxutil/table-util/init.luau +938 -0
- package/vendor/rbxutil/table-util/init.test.luau +439 -0
- package/vendor/rbxutil/table-util/wally.toml +8 -0
- package/vendor/rbxutil/task-queue/index.d.ts +27 -0
- package/vendor/rbxutil/task-queue/init.luau +97 -0
- package/vendor/rbxutil/task-queue/wally.toml +8 -0
- package/vendor/rbxutil/timer/index.d.ts +81 -0
- package/vendor/rbxutil/timer/init.luau +249 -0
- package/vendor/rbxutil/timer/init.test.luau +73 -0
- package/vendor/rbxutil/timer/wally.toml +11 -0
- package/vendor/rbxutil/tree/index.d.ts +15 -0
- package/vendor/rbxutil/tree/init.luau +137 -0
- package/vendor/rbxutil/tree/wally.toml +8 -0
- package/vendor/rbxutil/trove/index.d.ts +46 -0
- package/vendor/rbxutil/trove/init.luau +787 -0
- package/vendor/rbxutil/trove/init.test.luau +203 -0
- package/vendor/rbxutil/trove/wally.toml +8 -0
- package/vendor/rbxutil/typed-remote/init.luau +196 -0
- package/vendor/rbxutil/typed-remote/wally.toml +8 -0
- package/vendor/rbxutil/wait-for/index.d.ts +17 -0
- package/vendor/rbxutil/wait-for/init.luau +257 -0
- package/vendor/rbxutil/wait-for/init.test.luau +182 -0
- package/vendor/rbxutil/wait-for/wally.toml +11 -0
- package/vendor/t/t.lua +1350 -0
- package/vendor/testez/Context.lua +26 -0
- package/vendor/testez/Expectation.lua +311 -0
- package/vendor/testez/ExpectationContext.lua +38 -0
- package/vendor/testez/LifecycleHooks.lua +89 -0
- package/vendor/testez/Reporters/TeamCityReporter.lua +102 -0
- package/vendor/testez/Reporters/TextReporter.lua +106 -0
- package/vendor/testez/Reporters/TextReporterQuiet.lua +97 -0
- package/vendor/testez/TestBootstrap.lua +147 -0
- package/vendor/testez/TestEnum.lua +28 -0
- package/vendor/testez/TestPlan.lua +304 -0
- package/vendor/testez/TestPlanner.lua +40 -0
- package/vendor/testez/TestResults.lua +112 -0
- package/vendor/testez/TestRunner.lua +188 -0
- package/vendor/testez/TestSession.lua +243 -0
- package/vendor/testez/init.lua +40 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
--!strict
|
|
2
|
+
|
|
3
|
+
-- Ser
|
|
4
|
+
-- Stephen Leitnick
|
|
5
|
+
-- August 28, 2020
|
|
6
|
+
|
|
7
|
+
--[[
|
|
8
|
+
|
|
9
|
+
Ser is a serialization/deserialization utility module that is used
|
|
10
|
+
by Knit to automatically serialize/deserialize values passing
|
|
11
|
+
through remote functions and remote events.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Ser.Classes = {
|
|
15
|
+
[ClassName] = {
|
|
16
|
+
Serialize = (value) -> serializedValue
|
|
17
|
+
Deserialize = (value) => deserializedValue
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Ser.SerializeArgs(...) -> table
|
|
22
|
+
Ser.SerializeArgsAndUnpack(...) -> Tuple
|
|
23
|
+
Ser.DeserializeArgs(...) -> table
|
|
24
|
+
Ser.DeserializeArgsAndUnpack(...) -> Tuple
|
|
25
|
+
Ser.Serialize(value: any) -> any
|
|
26
|
+
Ser.Deserialize(value: any) -> any
|
|
27
|
+
Ser.UnpackArgs(args: table) -> Tuple
|
|
28
|
+
|
|
29
|
+
--]]
|
|
30
|
+
|
|
31
|
+
type Args = {
|
|
32
|
+
n: number,
|
|
33
|
+
[any]: any,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
local Option = require(script.Parent.Option)
|
|
37
|
+
|
|
38
|
+
--[=[
|
|
39
|
+
@class Ser
|
|
40
|
+
|
|
41
|
+
Library for serializing and deserializing data.
|
|
42
|
+
|
|
43
|
+
See the `Classes` property for information on extending the use
|
|
44
|
+
of the Ser library to include other classes.
|
|
45
|
+
|
|
46
|
+
]=]
|
|
47
|
+
local Ser = {}
|
|
48
|
+
|
|
49
|
+
--[=[
|
|
50
|
+
@within Ser
|
|
51
|
+
@prop Classes table
|
|
52
|
+
|
|
53
|
+
A dictionary of classes along with a Serialize and Deserialize function.
|
|
54
|
+
For instance, the default class added is the Option class, which looks
|
|
55
|
+
like the following:
|
|
56
|
+
|
|
57
|
+
```lua
|
|
58
|
+
Ser.Classes.Option = {
|
|
59
|
+
Serialize = function(opt) return opt:Serialize() end;
|
|
60
|
+
Deserialize = Option.Deserialize;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Add to this table in order to extend what classes are automatically
|
|
65
|
+
serialized/deserialized.
|
|
66
|
+
|
|
67
|
+
The Ser library checks every object's `ClassName` field in both serialized
|
|
68
|
+
and deserialized data in order to map it to the correct function within
|
|
69
|
+
the Classes table.
|
|
70
|
+
]=]
|
|
71
|
+
Ser.Classes = {
|
|
72
|
+
Option = {
|
|
73
|
+
Serialize = function(opt)
|
|
74
|
+
return opt:Serialize()
|
|
75
|
+
end,
|
|
76
|
+
Deserialize = Option.Deserialize,
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
--[=[
|
|
81
|
+
@param ... any
|
|
82
|
+
@return args: table
|
|
83
|
+
Serializes the arguments and returns the serialized values in a table.
|
|
84
|
+
]=]
|
|
85
|
+
function Ser.SerializeArgs(...: any): Args
|
|
86
|
+
local args = table.pack(...)
|
|
87
|
+
for i, arg in ipairs(args) do
|
|
88
|
+
if type(arg) == "table" then
|
|
89
|
+
local ser = Ser.Classes[arg.ClassName]
|
|
90
|
+
if ser then
|
|
91
|
+
args[i] = ser.Serialize(arg)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
return args
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
--[=[
|
|
99
|
+
@param ... any
|
|
100
|
+
@return args: ...any
|
|
101
|
+
Serializes the arguments and returns the serialized values.
|
|
102
|
+
]=]
|
|
103
|
+
function Ser.SerializeArgsAndUnpack(...: any): ...any
|
|
104
|
+
local args = Ser.SerializeArgs(...)
|
|
105
|
+
return table.unpack(args, 1, args.n)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
--[=[
|
|
109
|
+
@param ... any
|
|
110
|
+
@return args: table
|
|
111
|
+
Deserializes the arguments and returns the deserialized values in a table.
|
|
112
|
+
]=]
|
|
113
|
+
function Ser.DeserializeArgs(...: any): Args
|
|
114
|
+
local args = table.pack(...)
|
|
115
|
+
for i, arg in ipairs(args) do
|
|
116
|
+
if type(arg) == "table" then
|
|
117
|
+
local ser = Ser.Classes[arg.ClassName]
|
|
118
|
+
if ser then
|
|
119
|
+
args[i] = ser.Deserialize(arg)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
return args
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
--[=[
|
|
127
|
+
@param ... any
|
|
128
|
+
@return args: table
|
|
129
|
+
Deserializes the arguments and returns the deserialized values.
|
|
130
|
+
]=]
|
|
131
|
+
function Ser.DeserializeArgsAndUnpack(...: any): ...any
|
|
132
|
+
local args = Ser.DeserializeArgs(...)
|
|
133
|
+
return table.unpack(args, 1, args.n)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
--[=[
|
|
137
|
+
@param value any
|
|
138
|
+
@return any
|
|
139
|
+
Serializes the given value.
|
|
140
|
+
]=]
|
|
141
|
+
function Ser.Serialize(value: any): any
|
|
142
|
+
if type(value) == "table" then
|
|
143
|
+
local ser = Ser.Classes[value.ClassName]
|
|
144
|
+
if ser then
|
|
145
|
+
value = ser.Serialize(value)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
return value
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
--[=[
|
|
152
|
+
@param value any
|
|
153
|
+
@return any
|
|
154
|
+
Deserializes the given value.
|
|
155
|
+
]=]
|
|
156
|
+
function Ser.Deserialize(value: any): any
|
|
157
|
+
if type(value) == "table" then
|
|
158
|
+
local ser = Ser.Classes[value.ClassName]
|
|
159
|
+
if ser then
|
|
160
|
+
value = ser.Deserialize(value)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
return value
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
--[=[
|
|
167
|
+
@param value any
|
|
168
|
+
@return any
|
|
169
|
+
Unpacks the arguments returned by either `SerializeArgs` or `DeserializeArgs`.
|
|
170
|
+
]=]
|
|
171
|
+
function Ser.UnpackArgs(value: Args): ...any
|
|
172
|
+
return table.unpack(value, 1, value.n)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
return Ser
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
local ServerScriptService = game:GetService("ServerScriptService")
|
|
2
|
+
|
|
3
|
+
local Test = require(ServerScriptService.TestRunner.Test)
|
|
4
|
+
|
|
5
|
+
return function(ctx: Test.TestContext)
|
|
6
|
+
local Option = require(script.Parent.Parent.Option)
|
|
7
|
+
local Ser = require(script.Parent)
|
|
8
|
+
|
|
9
|
+
ctx:Describe("SerializeArgs", function()
|
|
10
|
+
ctx:Test("should serialize an option", function()
|
|
11
|
+
local opt = Option.Some(32)
|
|
12
|
+
local serOpt = table.unpack(Ser.SerializeArgs(opt))
|
|
13
|
+
ctx:Expect(serOpt.ClassName):ToBe("Option")
|
|
14
|
+
ctx:Expect(serOpt.Value):ToBe(32)
|
|
15
|
+
end)
|
|
16
|
+
end)
|
|
17
|
+
|
|
18
|
+
ctx:Describe("SerializeArgsAndUnpack", function()
|
|
19
|
+
ctx:Test("should serialize an option", function()
|
|
20
|
+
local opt = Option.Some(32)
|
|
21
|
+
local serOpt = Ser.SerializeArgsAndUnpack(opt)
|
|
22
|
+
ctx:Expect(serOpt.ClassName):ToBe("Option")
|
|
23
|
+
ctx:Expect(serOpt.Value):ToBe(32)
|
|
24
|
+
end)
|
|
25
|
+
end)
|
|
26
|
+
|
|
27
|
+
ctx:Describe("DeserializeArgs", function()
|
|
28
|
+
ctx:Test("should deserialize args to option", function()
|
|
29
|
+
local serOpt = {
|
|
30
|
+
ClassName = "Option",
|
|
31
|
+
Value = 32,
|
|
32
|
+
}
|
|
33
|
+
local opt = table.unpack(Ser.DeserializeArgs(serOpt))
|
|
34
|
+
ctx:Expect(Option.Is(opt)):ToBe(true)
|
|
35
|
+
ctx:Expect(opt:Contains(32)):ToBe(true)
|
|
36
|
+
end)
|
|
37
|
+
end)
|
|
38
|
+
|
|
39
|
+
ctx:Describe("DeserializeArgsAndUnpack", function()
|
|
40
|
+
ctx:Test("should deserialize args to option", function()
|
|
41
|
+
local serOpt = {
|
|
42
|
+
ClassName = "Option",
|
|
43
|
+
Value = 32,
|
|
44
|
+
}
|
|
45
|
+
local opt = Ser.DeserializeArgsAndUnpack(serOpt)
|
|
46
|
+
ctx:Expect(Option.Is(opt)):ToBe(true)
|
|
47
|
+
ctx:Expect(opt:Contains(32)):ToBe(true)
|
|
48
|
+
end)
|
|
49
|
+
end)
|
|
50
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "sleitnick/ser"
|
|
3
|
+
description = "Ser class for serialization and deserialization"
|
|
4
|
+
version = "1.0.5"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
authors = ["Stephen Leitnick"]
|
|
7
|
+
registry = "https://github.com/UpliftGames/wally-index"
|
|
8
|
+
realm = "shared"
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
Option = "sleitnick/option@^1.0"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare namespace Shake {
|
|
2
|
+
interface Constructor {
|
|
3
|
+
new (): Shake;
|
|
4
|
+
|
|
5
|
+
InverseSquare: (shake: Vector3, distance: number) => Vector3;
|
|
6
|
+
NextRenderName: () => string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type UpdateReturn = [position: Vector3, rotation: Vector3, done: boolean];
|
|
11
|
+
|
|
12
|
+
interface Shake {
|
|
13
|
+
Amplitude: number;
|
|
14
|
+
Frequency: number;
|
|
15
|
+
FadeInTime: number;
|
|
16
|
+
FadeOutTime: number;
|
|
17
|
+
SustainTime: number;
|
|
18
|
+
Sustain: boolean;
|
|
19
|
+
PositionInfluence: Vector3;
|
|
20
|
+
RotationInfluence: Vector3;
|
|
21
|
+
TimeFunction: () => number;
|
|
22
|
+
|
|
23
|
+
Start(): void;
|
|
24
|
+
Stop(): void;
|
|
25
|
+
IsShaking(): boolean;
|
|
26
|
+
StopSustain(): void;
|
|
27
|
+
Update(): LuaTuple<UpdateReturn>;
|
|
28
|
+
OnSignal(signal: RBXScriptSignal, callback: (...args: UpdateReturn) => void): RBXScriptConnection;
|
|
29
|
+
BindToRenderStep(name: string, priority: number, callback: (...args: UpdateReturn) => void): void;
|
|
30
|
+
Clone(): Shake;
|
|
31
|
+
Destroy(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare const Shake: Shake.Constructor;
|
|
35
|
+
|
|
36
|
+
export = Shake;
|