chore: prepare for AbstractCharacter extraction
This commit is contained in:
parent
698d6697fb
commit
00396522fb
1 changed files with 9 additions and 5 deletions
|
@ -36,15 +36,19 @@ function CharacterManager:new(controller)
|
||||||
end
|
end
|
||||||
|
|
||||||
function CharacterManager:init()
|
function CharacterManager:init()
|
||||||
for k, v in pairs(self.namelist) do
|
for k, name in pairs(self.namelist) do
|
||||||
local dir = "datas/gamedata/characters/" .. v .. "/init.lua"
|
if (self:charDataExists(name)) then
|
||||||
local fileinfo = love.filesystem.getInfo(dir)
|
self:initCharacter(name)
|
||||||
if fileinfo ~= nil then
|
|
||||||
self:initCharacter(v)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function CharacterManager:charDataExists(name)
|
||||||
|
local dir = "datas/gamedata/characters/" .. name .. "/init.lua"
|
||||||
|
local fileinfo = love.filesystem.getInfo(dir)
|
||||||
|
return (fileinfo ~= nil)
|
||||||
|
end
|
||||||
|
|
||||||
function CharacterManager:getCharacterData(charname)
|
function CharacterManager:getCharacterData(charname)
|
||||||
-- va eprmettre de récupérer les données d'un personnage
|
-- va eprmettre de récupérer les données d'un personnage
|
||||||
local charfolder = "datas.gamedata.characters." .. charname
|
local charfolder = "datas.gamedata.characters." .. charname
|
||||||
|
|
Loading…
Reference in a new issue