ZLP1/scripts/lists.lua

61 lines
1.3 KiB
Lua
Raw Permalink Normal View History

2021-12-31 01:46:21 +00:00
List = {}
2022-01-17 23:53:03 +00:00
-- Gameplay lists
2021-12-31 01:46:21 +00:00
List.Simulate = {}
List.Enemy = {}
List.EnemyBullet = {}
List.FriendlyBullet = {}
2021-12-31 11:21:48 +00:00
-- Animations
2021-12-31 01:46:21 +00:00
List.AnimationContainers = {}
2022-01-17 23:53:03 +00:00
-- UI Elements
List.UIElement = {}
--[[
function AddToList(self, target) -- object where to store id, string name.
table.insert(List[target],self)
self.id[target] = #list
end
function RemoveFromList(self, list)
end
for _, value in pairs(self.id) do
RemoveFromList(self,value)
--[[function Entity:RemoveList(list)
if list == List.Simulate then
for _, e in pairs(list) do
if e.id.Simulate > self.id.Simulate then
e.id.Simulate = e.id.Simulate - 1
end
end
table.remove(list,self.id.Simulate)
elseif list == List.Enemy then
for _, e in pairs(list) do
if e.id.Enemy > self.id.Enemy then
e.id.Enemy = e.id.Enemy - 1
end
end
table.remove(list,self.id.Enemy)
elseif list == List.EnemyBullet then
for _, e in pairs(list) do
if e.id.EnemyBullet > self.id.EnemyBullet then
e.id.EnemyBullet = e.id.EnemyBullet - 1
end
end
table.remove(list,self.id.EnemyBullet)
elseif list == List.FriendlyBullet then
for _, e in pairs(list) do
if e.id.FriendlyBullet > self.id.FriendlyBullet then
e.id.FriendlyBullet = e.id.FriendlyBullet - 1
end
end
table.remove(list,self.id.FriendlyBullet)
end
end
]]