diff --git a/classes/beastfile.lua b/classes/beastfile.lua index 5c4a8c8..6fd77cb 100644 --- a/classes/beastfile.lua +++ b/classes/beastfile.lua @@ -38,10 +38,10 @@ function BeastFile:loadMixin(mixin) end end -function BeastFile:prepareJson(simplercreatures, creatures) +function BeastFile:prepareJson(simplercreatures, creatures, parent) assert(simplercreatures ~= nil) assert(creatures ~= nil) - self.datas:prepareJson(simplercreatures, creatures) + self.datas:prepareJson(simplercreatures, creatures, parent) end return BeastFile \ No newline at end of file diff --git a/classes/dataholders/simpleholder.lua b/classes/dataholders/simpleholder.lua index af7371a..12beb12 100644 --- a/classes/dataholders/simpleholder.lua +++ b/classes/dataholders/simpleholder.lua @@ -7,7 +7,6 @@ function SimpleHolder:new(key, datas) end function SimpleHolder:applyCommand(command, args) - print(self.key, command, args) self.value = args end diff --git a/classes/datalist.lua b/classes/datalist.lua index 1174261..cdaf20d 100644 --- a/classes/datalist.lua +++ b/classes/datalist.lua @@ -97,9 +97,11 @@ function DataList:reduce() --TODO end -function DataList:prepareJson(simplercreatures, creatures) +function DataList:prepareJson(simplercreatures, creatures, parent) self:reduce() + self.reducedList.parent = parent + table.insert(simplercreatures, {nom = self.reducedList.name, level = self.reducedList.level, nomType = self.reducedList.nomType, categorie = self.reducedList.categorie}) table.insert(creatures, self.reducedList) end diff --git a/classes/folderloader.lua b/classes/folderloader.lua index 47da205..82a5f5d 100644 --- a/classes/folderloader.lua +++ b/classes/folderloader.lua @@ -29,7 +29,7 @@ end function FolderLoader:prepareJson(simplercreatures, creatures) for _, file in ipairs(self.files) do - file:prepareJson(simplercreatures, creatures) + file:prepareJson(simplercreatures, creatures, self.data.nom) end end