Chages for Ensure; Add planned mod folders; Move utf8_api to Utf8
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
|||||||
[submodule "mods/API/utf8_api"]
|
[submodule "mods/API/utf8_api"]
|
||||||
path = mods/API/utf8_api
|
path = mods/API/Utf8
|
||||||
url = https://github.com/ApancoreStudio/utf8_api.git
|
url = https://github.com/ApancoreStudio/utf8_api.git
|
||||||
|
|||||||
@@ -9,18 +9,34 @@ Ensure = {}
|
|||||||
--- @param function_name string Name of the parent function for error reporting
|
--- @param function_name string Name of the parent function for error reporting
|
||||||
function Ensure.argType(arg, expectedType, n, function_name)
|
function Ensure.argType(arg, expectedType, n, function_name)
|
||||||
local actualType = type(arg)
|
local actualType = type(arg)
|
||||||
assert(actualType == expectedType, 'bad argument #%s to \'%s\' (%s expected, got %s)', tostring(n), function_name, expectedType, actualType)
|
assert(actualType == expectedType, string.format(
|
||||||
|
'bad argument #%s to \'%s\' (%s expected, got %s)',
|
||||||
|
tostring(n),
|
||||||
|
function_name,
|
||||||
|
expectedType,
|
||||||
|
actualType))
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param arg any The argument value to type-check
|
local ensureArgType = Ensure.argType
|
||||||
--- @param n number Argument position in function call (1-based index)
|
|
||||||
|
--- @param arg string The string to check
|
||||||
|
--- @param n number Argument position in function call (1-based index)
|
||||||
|
--- @param function_name string Name of the parent function for error reporting
|
||||||
|
function Ensure.stringArgNotEmpty(arg, n, function_name)
|
||||||
|
ensureArgType(arg, 'string', 1, 'Ensure.stringArgNotEmpty')
|
||||||
|
assert(#arg ~= 0, string.format('bad argument #%s to \'%s\' (string cannot be empty)', n, function_name))
|
||||||
|
end
|
||||||
|
|
||||||
|
--- @param arg any The argument value to check
|
||||||
|
--- @param n number Argument position in function call (1-based index)
|
||||||
--- @param function_name string Name of the parent function for error reporting
|
--- @param function_name string Name of the parent function for error reporting
|
||||||
function Ensure.argNotNil(arg, n, function_name)
|
function Ensure.argNotNil(arg, n, function_name)
|
||||||
assert(arg ~= nil, 'bad argument #%s to \'%s\' (key cannot be nil)', n, function_name)
|
assert(arg ~= nil, string.format('bad argument #%s to \'%s\' (key cannot be nil)', n, function_name))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param divider number The number to check
|
||||||
|
--- @param function_name string Name of the parent function for error reporting
|
||||||
function Ensure.zeroDivision(divider, function_name)
|
function Ensure.zeroDivision(divider, function_name)
|
||||||
assert(divider ~= 0, 'Division by zero in \'%s\'', function_name)
|
assert(divider ~= 0, string.format('Division by zero in \'%s\'', function_name))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
name = smc__api
|
||||||
|
|||||||
0
mods/CORE/DynamicRecipe/init.lua
Normal file
0
mods/CORE/DynamicRecipe/init.lua
Normal file
1
mods/CORE/DynamicRecipe/mod.conf
Normal file
1
mods/CORE/DynamicRecipe/mod.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
name = core__dynamic_recipe
|
||||||
0
mods/CORE/ItemStackTimer/init.lua
Normal file
0
mods/CORE/ItemStackTimer/init.lua
Normal file
1
mods/CORE/ItemStackTimer/mod.conf
Normal file
1
mods/CORE/ItemStackTimer/mod.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
name = core__item_stack_timer
|
||||||
0
mods/CORE/Tag/init.lua
Normal file
0
mods/CORE/Tag/init.lua
Normal file
1
mods/CORE/Tag/mod.conf
Normal file
1
mods/CORE/Tag/mod.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
name = core__tag
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
name = smc__core
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
name = smc__enviroment
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
name = smc__ui
|
||||||
|
|||||||
1
mods/UI/modpack.conf
Normal file
1
mods/UI/modpack.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
name = smc__ui
|
||||||
Reference in New Issue
Block a user