From 27cf265287e705fd9e09091bf7c5325b8a21a52c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 26 Jul 2019 17:36:25 +0200 Subject: [PATCH] feat: add some map utils --- .../game/modules/utils/init.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sonic-radiance.love/game/modules/utils/init.lua diff --git a/sonic-radiance.love/game/modules/utils/init.lua b/sonic-radiance.love/game/modules/utils/init.lua new file mode 100644 index 0000000..870735b --- /dev/null +++ b/sonic-radiance.love/game/modules/utils/init.lua @@ -0,0 +1,19 @@ +local gameutils = {} + +function gameutils.getMapPath(maptype, mapname) + if (maptype ~= "battle") then + error("Map type " .. maptype .. " doesn't exist.") + end + + return "datas.gamedata.maps." .. maptype .. "." .. mapname +end + +function gameutils.getMapDirectory(maptype, mapname) + if (maptype ~= "battle") then + error("Map type " .. maptype .. " doesn't exist.") + end + + return "datas/gamedata/maps/" .. maptype .. "/" .. mapname .. "/" +end + +return gameutils