整理代码,调整local函数名规范(较边缘的代码不必遵守,比如外部的库和小程序):

特别临时性的用全大写字母缩写或者单字母
TASK模块用到的任务函数和检查函数开头分别为task_和check_
其他函数开头添加下划线作为指示
This commit is contained in:
MrZ626
2021-08-25 02:40:01 +08:00
parent ee55055385
commit 8f910f95f4
40 changed files with 470 additions and 466 deletions

View File

@@ -82,7 +82,7 @@ local nullIndex={
end
}
local PLYlist,PLYmap=setmetatable({},nullIndex),setmetatable({},nullIndex)
local function freshPos()
local function _freshPos()
table.sort(PLYlist,_placeSort)
if #PLYlist<=5 then
posList=posLists[1]
@@ -99,7 +99,7 @@ end
netPLY={
list=PLYlist,
map=PLYmap,
freshPos=freshPos,
freshPos=_freshPos,
}
function netPLY.clear()
@@ -122,14 +122,14 @@ function netPLY.add(d)
ins(PLYlist,p)
PLYmap[p.uid]=p
freshPos()
_freshPos()
end
function netPLY.remove(sid)
for i=1,#PLYlist do
if PLYlist[i].sid==sid then
PLYmap[PLYlist[i].uid]=nil
rem(PLYlist,i)
freshPos()
_freshPos()
break
end
end
@@ -205,7 +205,7 @@ function netPLY.update()
end
local stencilW,stencilH
local function plyStencil()
local function _playerFrameStencil()
gc_rectangle('fill',0,0,stencilW,stencilH)
end
function netPLY.draw()
@@ -229,7 +229,7 @@ function netPLY.draw()
--Stencil
stencilW,stencilH=p.w,p.h
gc_setStencilTest('equal',1)
gc_stencil(plyStencil)
gc_stencil(_playerFrameStencil)
gc_setColor(1,1,1)
--Avatar