aboutsummaryrefslogtreecommitdiff
path: root/lua/pets.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/pets.lua')
-rw-r--r--lua/pets.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/pets.lua b/lua/pets.lua
index ed827db..b76df2e 100644
--- a/lua/pets.lua
+++ b/lua/pets.lua
@@ -23,7 +23,7 @@ function M.setup(options)
end
-- create a Pet object and add it to the pets table
-function M.create_pet(name, type, style)
+function M.create_pet(name, type, style) -- TODO: don't allow duplicate names
local pet = require("pets.pet").Pet.new(name, type, style)
pet:animate()
table.insert(M.pets, pet)
@@ -37,4 +37,10 @@ function M.kill_all()
end
end
+function M.list()
+ for _, pet in pairs(M.pets) do
+ print(pet.name)
+ end
+end
+
return M