local PigManager = Object:extend()

function PigManager:new(controller)
  self.controller = controller

  self.data      = {}
end

function PigManager:addPig(race)
  local pig   = {}
  pig.race    = race
  pig.name    = "Pigguy"

  pig.atk     = 1
  pig.def     = 1
  pig.int     = 1
  pig.spd     = 1
  pig.mag     = 1

  pig.maxHP   = 20
  pig.maxMP   = 5

  pig.weaponList  = {1, 2, 1, 1}
  pig.hat     = 0
  pig.equip   = 0
  pig.shield  = 0

  table.insert(self.data, pig)
end

function PigManager:getPig(pigID)
  if pigID == nil then
    error("FATAL: pigID can't be nil")
  end
  pigData = self.data[pigID]
  if pigData == nil then
    error("FATAL: savegame pig data " .. pigID .. " is empty")
  end
  return pigData
end

function PigManager:getData()
  return self.data
end

function PigManager:setData(data)
  self.data = data
end

return PigManager
