-------------------------------------------------------------------------------
---   Modular Simulator Controller System - Action Callbacks Script         ---
---                                                                         ---
---   Author:     Oliver Juwig (TheBigO)                                    ---
---   License:    (2026) Creative Commons - BY-NC-SA                        ---
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
---                           Public Modules Section                        ---
-------------------------------------------------------------------------------

Assistant = {}
Controller = {}
Function = {}
Rules = {}


-------------------------------------------------------------------------------
---                          Public Functions Section                       ---
-------------------------------------------------------------------------------


Assistant.Ask = __Assistant_Ask

Assistant.Command = __Assistant_Command

function Assistant.Speak(message, ...)
	local arguments = table.pack(...)
	
	assert(#arguments == 0 or (#arguments == 1 and type(arguments[1]) == "boolean"))
	
	return __Assistant_Speak(message, table.unpack(arguments))
end

Assistant.Call = __Assistant_Call

Assistant.Property = __Assistant_Property

Controller.Call = __Controller_Call

Function.Call = __Function_Call

function Rules.GetValue(name, ...)
	local arguments = table.pack(...)
	local value = __Rules_GetValue(name)
	
	assert(#arguments <= 1)
	
	if #arguments == 1 then
		if value == nil then
			value = arguments[1]
		elseif (value == __NotInitialized or value == __Undefined) then
			value = arguments[1]
		end
	elseif #arguments == 0 and (value == __NotInitialized or value == __Undefined) then
		value = nil
	end
		
	return value
end

Rules.SetValue = __Rules_SetValue

Rules.Execute = __Rules_Execute

Rules.Produce = __Rules_Execute