Skip to content

Commit 9db1f79

Browse files
committed
gen(stylua): initial formatting of entire codebase
1 parent d88bed3 commit 9db1f79

1,421 files changed

Lines changed: 178457 additions & 184495 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

EngineOptions.lua

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@
2525
-- Example EngineOptions.lua
2626
--
2727

28-
local options =
29-
{
28+
local options = {
3029
{
31-
key="engineoptions",
32-
name="Engine Options",
33-
desc="Engine Options",
34-
type="section",
30+
key = "engineoptions",
31+
name = "Engine Options",
32+
desc = "Engine Options",
33+
type = "section",
3534
},
3635
{
37-
key = 'maxunits',
38-
name = 'Max units',
39-
desc = 'Maximum number of units (including buildings) for each team allowed at the same time',
40-
type = 'number',
41-
section= 'engineoptions',
42-
def = 2000,
43-
min = 1,
44-
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
45-
step = 1,
36+
key = "maxunits",
37+
name = "Max units",
38+
desc = "Maximum number of units (including buildings) for each team allowed at the same time",
39+
type = "number",
40+
section = "engineoptions",
41+
def = 2000,
42+
min = 1,
43+
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
44+
step = 1,
4645
},
4746
}
4847

common/SetList.lua

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
-- A SetList is a data structure used for storing only keys, any key is valid (no values!)
33
-- It consists of a hash part for fast containment checks
44
-- And a list part for fast random generation
5-
local function tstr(t,n)
6-
if t==nil then return end
7-
local res = tostring(n or "") .. ' {'
8-
for k,v in pairs(t) do res = res .. tostring(k) .. "=" .. tostring(v) ..", " end
9-
print( res .. '}')
5+
local function tstr(t, n)
6+
if t == nil then
7+
return
8+
end
9+
local res = tostring(n or "") .. " {"
10+
for k, v in pairs(t) do
11+
res = res .. tostring(k) .. "=" .. tostring(v) .. ", "
12+
end
13+
print(res .. "}")
1014
end
1115

1216
local mRandom = math.random
@@ -15,39 +19,39 @@ SetListMT.__index = SetListMT
1519
function SetListMT:Add(key)
1620
if self.hash[key] == nil then -- So that we dont add twice
1721
self.count = self.count + 1
18-
self.hash[key] = self.count
22+
self.hash[key] = self.count
1923
self.list[self.count] = key
2024
end
2125
end
2226
function SetListMT:Remove(key)
2327
local popindex = self.hash[key]
2428
if popindex then
25-
if popindex ~= self.count then
29+
if popindex ~= self.count then
2630
-- If not last element, then take the element at the very back, and emplace it at popindex
2731
local popkey = self.list[self.count]
28-
self.list[popindex] = popkey -- bring it back in list
32+
self.list[popindex] = popkey -- bring it back in list
2933
self.hash[popkey] = popindex
3034
end
3135
self.list[self.count] = nil
32-
self.hash[key] = nil
36+
self.hash[key] = nil
3337
self.count = self.count - 1
3438
end
35-
3639
end
3740
function SetListMT:GetRandom()
38-
if self.count > 0 then return self.list[mRandom(1, self.count)] end
41+
if self.count > 0 then
42+
return self.list[mRandom(1, self.count)]
43+
end
3944
end
4045
local function NewSetList()
4146
local t = {
42-
hash = {}, -- Hash table map keys to positions in list
47+
hash = {}, -- Hash table map keys to positions in list
4348
list = {}, -- List table maps positions in list to keys
4449
count = 0, -- Keeps a tally of how many elements
45-
}
50+
}
4651
setmetatable(t, SetListMT)
4752
return t
4853
end
4954

50-
5155
-- A SetListMin is a data structure used for storing only positive integer keys or strings (no values!)
5256
-- It consists of only a hash part. Negative numbers are not allowed
5357
local setListMinMT = {}
@@ -62,30 +66,31 @@ end
6266
function setListMinMT:Remove(key)
6367
local popindex = self.hash[key]
6468
if popindex then
65-
if popindex ~= self.count then
69+
if popindex ~= self.count then
6670
-- If not last element, then take the element at the very back, and emplace it at popindex
6771
local popkey = self.hash[-1 * self.count]
68-
self.hash[-1 * popindex] = popkey -- bring it back in list
72+
self.hash[-1 * popindex] = popkey -- bring it back in list
6973
self.hash[popkey] = popindex
7074
end
71-
self.hash[-1* self.count] = nil
72-
self.hash[key] = nil
75+
self.hash[-1 * self.count] = nil
76+
self.hash[key] = nil
7377
self.count = self.count - 1
7478
end
7579
end
7680
function setListMinMT:GetRandom()
77-
if self.count > 0 then return self.hash[-1 * mRandom(1, self.count)] end
81+
if self.count > 0 then
82+
return self.hash[-1 * mRandom(1, self.count)]
83+
end
7884
end
7985
local function NewSetListMin()
8086
local t = {
81-
hash = {}, -- Hash table map keys to positions in list
87+
hash = {}, -- Hash table map keys to positions in list
8288
count = 0, -- Keeps a tally of how many elements
83-
}
89+
}
8490
setmetatable(t, setListMinMT)
8591
return t
8692
end
8793

88-
8994
-- A SetListNoTable is a data structure used for storing only positive integer keys, or string keys which arent called 'count'
9095
-- It consists of only the table itself. Negative numbers are not allowed
9196

@@ -101,30 +106,32 @@ end
101106
function SetListNoTableMT:Remove(key)
102107
local popindex = self[key]
103108
if popindex then
104-
if popindex ~= self.count then
109+
if popindex ~= self.count then
105110
-- If not last element, then take the element at the very back, and emplace it at popindex
106111
local popkey = self[-1 * self.count]
107-
self[-1 * popindex] = popkey -- bring it back in list
112+
self[-1 * popindex] = popkey -- bring it back in list
108113
self[popkey] = popindex
109114
end
110115
self[-1 * self.count] = nil
111-
self[key] = nil
116+
self[key] = nil
112117
self.count = self.count - 1
113118
end
114119
end
115120
function SetListNoTableMT:GetRandom()
116-
if self.count > 0 then return self[-1 * mRandom(1, self.count)] end
121+
if self.count > 0 then
122+
return self[-1 * mRandom(1, self.count)]
123+
end
117124
end
118125
local function NewSetListNoTable()
119-
local t = {count = 0} -- Keeps a tally of how many elements
126+
local t = { count = 0 } -- Keeps a tally of how many elements
120127
setmetatable(t, SetListNoTableMT)
121128
return t
122129
end
123130

124131
local SetListUtilities = {
125132
NewSetListNoTable = NewSetListNoTable,
126-
NewSetListMin = NewSetListMin,
127-
NewSetList = NewSetList
133+
NewSetListMin = NewSetListMin,
134+
NewSetList = NewSetList,
128135
}
129136
return SetListUtilities
130137

@@ -205,4 +212,5 @@ end
205212
local deltat = os.clock()-t0
206213
print ("Time taken to test", "good old vanilla", deltat,"s")
207214
208-
]]--
215+
]]
216+
--

common/configs/LavaMaps/AcidicQuarry.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local conf = {
2020
fogHeight = 36,
2121
fogAbove = 0.1,
2222
fogDistortion = 2.0,
23-
tideRhythm = { { 4, 1.5, 5*6000 } },
23+
tideRhythm = { { 4, 1.5, 5 * 6000 } },
2424
}
2525

2626
return conf

common/configs/LavaMaps/Claymore.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local conf = {
1212
fogDistortion = 2.0,
1313
tideAmplitude = 0.3,
1414
tidePeriod = 1000,
15-
tideRhythm = { { -1, 1.5, 5*6000 } },
15+
tideRhythm = { { -1, 1.5, 5 * 6000 } },
1616
}
1717

1818
return conf

common/configs/LavaMaps/Forge.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ local conf = {
1616
fogHeight = 35,
1717
fogAbove = 0.18,
1818

19-
tideRhythm = { { -1, 7.5, 5*6000 } },
19+
tideRhythm = { { -1, 7.5, 5 * 6000 } },
2020
}
2121

2222
return conf

common/configs/LavaMaps/Ghenna Rising.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ local conf = {
99
shadowStrength = 0.9,
1010
coastLightBoost = 0.8,
1111
uvScale = 1.5,
12-
tideRhythm = { { 250, 3, 15 },
13-
{ 415, 1.5, 30 },
14-
{ 250, 3, 5*60 },
15-
{ 415, 1.5, 30 },
16-
{ 250, 3, 5*60 },
17-
{ 415, 1.5, 3*30 },
18-
{ 250, 3, 10*60 } },
12+
tideRhythm = { { 250, 3, 15 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 3 * 30 }, { 250, 3, 10 * 60 } },
1913
}
2014

2115
return conf
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
local conf = {
22
level = 100,
33
damage = 130,
4-
tideRhythm = { { 90, 7.5, 5*60 },
5-
{ 215, 3, 5 },
6-
{ 90, 7.5, 5*60 },
7-
{ 290, 4.5, 5 },
8-
{ 90, 7.5, 4*60 },
9-
{ 355, 6, 5 },
10-
{ 90, 7.5, 4*60 },
11-
{ 390, 6, 5 },
12-
{ 90, 7.5, 2*60 },
13-
{ 440, 1.2, 2*60 } },
4+
tideRhythm = { { 90, 7.5, 5 * 60 }, { 215, 3, 5 }, { 90, 7.5, 5 * 60 }, { 290, 4.5, 5 }, { 90, 7.5, 4 * 60 }, { 355, 6, 5 }, { 90, 7.5, 4 * 60 }, { 390, 6, 5 }, { 90, 7.5, 2 * 60 }, { 440, 1.2, 2 * 60 } },
145
}
156

167
return conf

common/configs/LavaMaps/Hyperion Shale.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local conf = {
1212
fogDistortion = 2.0,
1313
tideAmplitude = 0.3,
1414
tidePeriod = 1000,
15-
tideRhythm = { { -1, 1.5, 5*6000 } },
15+
tideRhythm = { { -1, 1.5, 5 * 6000 } },
1616
}
1717

1818
return conf

common/configs/LavaMaps/Incandescence Remake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ local conf = {
1616
fogHeight = 85,
1717
fogAbove = 0.18,
1818

19-
tideRhythm = { { 206, 7.5, 5*6000 } },
19+
tideRhythm = { { 206, 7.5, 5 * 6000 } },
2020
}
2121

2222
return conf

common/configs/LavaMaps/Kings Assault.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local conf = {
1010
fogDistortion = 2.0,
1111
tideAmplitude = 0.3,
1212
tidePeriod = 1000,
13-
tideRhythm = { { -1, 1.5, 5*6000 } },
13+
tideRhythm = { { -1, 1.5, 5 * 6000 } },
1414
}
1515

1616
return conf

0 commit comments

Comments
 (0)