* Remove utils.routines
This commit is contained in:
Applevangelist
2023-09-07 18:01:16 +02:00
parent 58f60dbf1b
commit 568f76b0b2
15 changed files with 28 additions and 32 deletions

View File

@@ -25,7 +25,7 @@ routines.utils.round = function( number, decimals )
end
-- from http://lua-users.org/wiki/CopyTable
routines.utils.deepCopy = function( object )
UTILS.DeepCopy = function( object )
local lookup_table = {}
local function _copy( object )
if type( object ) ~= "table" then
@@ -474,7 +474,7 @@ function routines.getRandPointInCircle( point, radius, innerRadius )
end
routines.goRoute = function( group, path )
local misTask = { id = 'Mission', params = { route = { points = routines.utils.deepCopy( path ) } } }
local misTask = { id = 'Mission', params = { route = { points = UTILS.DeepCopy( path ) } } }
if type( group ) == 'string' then
group = Group.getByName( group )
end
@@ -1671,7 +1671,7 @@ routines.ground.patrolRoute = function( vars )
end
if pType and string.lower( pType ) == 'doubleback' then
local curRoute = routines.utils.deepCopy( useRoute )
local curRoute = UTILS.DeepCopy( useRoute )
for i = #curRoute, 2, -1 do
useRoute[#useRoute + 1] = routines.ground.buildWP( curRoute[i], curRoute[i].action, curRoute[i].speed )
end

View File

@@ -324,7 +324,7 @@ UTILS.OneLineSerialize = function( tbl ) -- serialization of a table all on a s
ind_str[#ind_str + 1] = ']='
else --must be a string
ind_str[#ind_str + 1] = '['
ind_str[#ind_str + 1] = routines.utils.basicSerialize(ind)
ind_str[#ind_str + 1] = UTILS.BasicSerialize(ind)
ind_str[#ind_str + 1] = ']='
end
@@ -335,7 +335,7 @@ UTILS.OneLineSerialize = function( tbl ) -- serialization of a table all on a s
tbl_str[#tbl_str + 1] = table.concat(ind_str)
tbl_str[#tbl_str + 1] = table.concat(val_str)
elseif type(val) == 'string' then
val_str[#val_str + 1] = routines.utils.basicSerialize(val)
val_str[#val_str + 1] = UTILS.BasicSerialize(val)
val_str[#val_str + 1] = ','
tbl_str[#tbl_str + 1] = table.concat(ind_str)
tbl_str[#tbl_str + 1] = table.concat(val_str)
@@ -358,7 +358,7 @@ UTILS.OneLineSerialize = function( tbl ) -- serialization of a table all on a s
tbl_str[#tbl_str + 1] = "f() " .. tostring(ind)
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
else
env.info('unable to serialize value type ' .. routines.utils.basicSerialize(type(val)) .. ' at index ' .. tostring(ind))
env.info('unable to serialize value type ' .. UTILS.BasicSerialize(type(val)) .. ' at index ' .. tostring(ind))
env.info( debug.traceback() )
end