MapTunnelNetwork

Map tunnel network

Usage: Used in 8 task(s)

Lua Implementation

-- Map Tunnel Network
function execute(params)
    local currentLoc = this:getLocation3D()

    -- Add current location to tunnel map
    local tunnelMap = this:getStateProperty("TunnelMap") or {}
    table.insert(tunnelMap, {
        location = currentLoc,
        timestamp = vrf.getSimulationTime(),
        connections = params.connections or {}
    })

    this:setStateProperty("TunnelMap", tunnelMap)
    return true
end