- Comence a implementar els objectes
This commit is contained in:
24
data/objects.lua
Normal file
24
data/objects.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
objects={
|
||||||
|
list={},
|
||||||
|
|
||||||
|
collect=function(obj)
|
||||||
|
table.insert(objects.list, obj)
|
||||||
|
end,
|
||||||
|
|
||||||
|
search=function(name)
|
||||||
|
for i,obj in ipairs(objects.list) do
|
||||||
|
if obj.name and obj.name==name then
|
||||||
|
table.remove(objects.list,i)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
leave=function(name)
|
||||||
|
for i,obj in ipairs(objects.list) do
|
||||||
|
if obj.name and obj.name==name then
|
||||||
|
return obj
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user