shallowcopy
Definition
-- @/=[C]:-1
function shallowcopy(...)
Callers
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/flowgraph/groupHelper.lua
newGraph.variables:_onDeserialized(oldGraph.variables:_onSerialize())
local selectedNodes = shallowcopy(self.mgr.selectedNodes)
local integratedNodes = {}
@/lua/vehicle/powertrain/centrifugalClutch.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/multiShaft.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/electricServo.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/flowgraph/states.lua
local open = {lnk}
local unvisited = shallowcopy(shorten)
repeat
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
if im.ColorButton(string.format("##pres_%s_%d", guiId, k), im.ImVec4(col[1],col[2],col[3],col[4]), nil, im.ImVec2(btnSize, btnSize)) then
value = shallowcopy(col)
changed = true
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
changed = true
@/lua/ge/extensions/ui/liveryEditor/layers.lua
if parentLayer then
uiLayer.path = shallowcopy(parentLayer.path)
table.insert(uiLayer.path, layer.uid)
uiLayer.pathIndices = shallowcopy(parentLayer.pathIndices)
table.insert(uiLayer.pathIndices, key)
parentUid = parentLayer and parentLayer.uid,
layer = shallowcopy(uiLayer),
hidden = hidden
@/lua/vehicle/powertrain/linearActuator.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/electricWinch.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/dctGearbox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/torsionReactor.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/common/utils.lua
-- creates a copy of the value or table. Non-recursive
function shallowcopy(orig)
if type(orig) == 'table' then
@/lua/ge/extensions/core/vehicles.lua
couplerTags[cid] = n.couplerTag
local data = shallowcopy(n)
couplerCache[cid] = data
@/lua/vehicle/beamstate.lua
if n.cid then
local data = shallowcopy(n)
couplerCache[n.cid] = data
couplerBreakGroupCacheOrig = shallowcopy(couplerBreakGroupCache)
@/lua/vehicle/powertrain/compressor.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/editor/api/dynamicDecals.lua
for _, prop in ipairs(cat) do
if not prop.value then prop.value = shallowcopy(prop.default) end
M.propertiesMap[prop.id] = prop
local data = deepcopy(M.getLayerByUid(layer.uid))
local layerDataCopy = shallowcopy(data)
data.cursorPosScreenUv = {x = data.dataPoints[1].x, y = data.dataPoints[1].y}
local data = deepcopy(M.getLayerByUid(layer.uid))
local layerDataCopy = shallowcopy(data)
data.cursorPosScreenUv = {x = data.dataPoints[1].x, y = data.dataPoints[1].y}
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/followWaypoints.lua
self.pinOut.finalWp.value = self.aiPath[#self.aiPath]
local aiPath = shallowcopy(self.aiPath)
if self.lapCount > 1 then
@/lua/ge/extensions/editor/dynamicDecals/selection.lua
elseif layerData.type == api.layerTypes.brushStroke then
local layerDataCopy = shallowcopy(layerData)
layerDataCopy.cursorPosScreenUv = {x = layerData.dataPoints[1].x, y = layerData.dataPoints[1].y}
elseif layerData.type == api.layerTypes.path then
local layerDataCopy = shallowcopy(layerData)
layerDataCopy.cursorPosScreenUv = {x = layerData.dataPoints[1].x, y = layerData.dataPoints[1].y}
@/lua/vehicle/controller/pneumatics.lua
local groupName = pressureData.groupName
local beamPressureLevels = shallowcopy(pressureLevels)
@/lua/ge/extensions/core/environment.lua
if timeObj and timeOfDay.time then
if not updatingWholeState then extensions.hook('onEnvironmentChanged', shallowcopy(timeOfDay)) end
if not environmentChangesEnabled then return end
@/lua/vehicle/powertrain/shaft.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/automaticGearbox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/hydraulicPump.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
bulkChangeTemplate = shallowcopy(textures.getSidecarTemplate())
bulkChangeTemplate.newTagName = ""
@/lua/ge/extensions/editor/driftDataEditor.lua
scl = 10,
score = shallowcopy(defaultPointsCopy.donutPoints)
})
scl = vec3(8, 1, 1),
score = shallowcopy(defaultPointsCopy.driftThroughPoints)
})
pos = pos + vec3(-10, 0, 0),
score = shallowcopy(defaultPointsCopy.hitPolePoints)
})
@/lua/vehicle/powertrain/torqueConverter.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/ui/liveryEditor/tools.lua
else
local selectedLayerUids = shallowcopy(uiSelectionApi.getSelectedLayers())
if selectedLayerUids then
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
local newName = editor.getTempCharPtr()
local newVal = shallowcopy(val)
table.remove(presets, i)
@/lua/vehicle/powertrain/rangeBox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/manualGearbox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
device.initialGearRatios = shallowcopy(device.gearRatios)
@/lua/vehicle/powertrain/frictionClutch.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/differential.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
if type(jbeamData.diffType) == "table" then
device.availableModes = shallowcopy(jbeamData.diffType)
device.mode = jbeamData.diffType[1] or "open"
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua
id = property.id,
value = shallowcopy(property.default),
}
@/lua/ge/extensions/gameplay/race/race.lua
local aiPath = shallowcopy(self.aiPath)
local lapCount = self.lapCount
@/lua/ge/extensions/editor/api/dynamicDecals/textures.lua
table.insert(missingSidecarFiles, filepath)
local data = shallowcopy(sidecarTemplate)
updateSidecarFile(textureFilePath, data)
table.insert(missingSidecarFiles, filepath)
local data = shallowcopy(sidecarTemplate)
jsonWriteFile(sidecarFilePath, data)
M.getAndFlushMissingSidecarFiles = function()
local res = shallowcopy(missingSidecarFiles)
missingSidecarFiles = nil
@/lua/ge/extensions/flowgraph/graph.lua
local open = { { sLink, sLink.sourcePin.name } }
local unvisited = shallowcopy(allLinks)
local inNodes = shallowcopy(allNodes)
local flowLevel = 0
@/lua/ge/extensions/editor/levelValidator.lua
-- Create a shallow copy and keep as Warning level
local modifiedItem = shallowcopy(logItem)
modifiedItem._originalLogLevel = logItem.logLevel
@/lua/vehicle/powertrain/combustionEngineThermals.lua
--copy table to not mess with the original one
local beams = shallowcopy(currentExhaustBeams)
local currentBeamKey, currentBeam = next(beams, nil)
@/lua/ge/extensions/editor/api/object.lua
local function calculateObjectsCenter(objects)
local stack = shallowcopy(objects)
local function calculateBoundingBoxCenter(objects)
local stack = shallowcopy(objects)
local bbox = Box3F()
@/lua/vehicle/powertrain/viscousClutch.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/sequentialGearbox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/genericTorqueProvider.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/cvtGearbox.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/editor/mainMenu.lua
for _, subitem in ipairs(menuGroups[item.itemText]) do
local entry = shallowcopy(subitem)
entry.name = item.itemText.." > "..subitem.itemText
else
local entry = shallowcopy(item)
entry.name = entry.itemText
@/lua/vehicle/powertrain/electricMotor.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/powertrain/splitShaft.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/vehicle/controller/esc.lua
if type(config) == "table" and config.escConfigurationEnabled then
table.insert(tmpConfigs, sanitizeConfiguration(shallowcopy(config), name)) --we need to create copies of all our configurations as we are going to use them for saving a few values as well and we want a fresh copy every time we reset the vehicle
end
@/lua/common/extensions.lua
end
local oldResolvedModules = shallowcopy(resolvedModules)
-- Note(AK) 27/10/2020: Setting luaMods[extName] = nil is IMPORTANT. This allows resolveDependencies to generate a new set of resolved tables
-- This fixes the bug where some modules do not get onDeserialize called because they have been dropped from these tables
local tempResolvedModules = shallowcopy(resolvedModules)
-- dropped from these tables
local tempResolvedModules = shallowcopy(resolvedModules)
@/lua/vehicle/powertrain/combustionEngine.lua
local device = {
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
deviceCategories = shallowcopy(M.deviceCategories),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
requiredExternalInertiaOutputs = shallowcopy(M.requiredExternalInertiaOutputs),
outputPorts = shallowcopy(M.outputPorts),
name = jbeamData.name,
@/lua/ge/extensions/ui/liveryEditor/editMode.lua
-- local newAppliedLayers = shallowcopy(M.appliedLayers)
-- table.remove(newAppliedLayers, index)
@/lua/ge/extensions/editor/roadUtils.lua
-- Apply templates to roads. Delete old child roads. Create new ones.
local allRoadsCopy = shallowcopy(editor.getAllRoads())
for roadID, _ in pairs(allRoadsCopy) do