local ScienceDataManager = BaseClass("ScienceDataManager")
local __init = function(self)
  self.allScience = {}
end
local __delete = function(self)
  self.allScience = nil
end
local InitData = function(self, message)
  if message.science_new ~= nil then
    self.allScience = {}
    for k, v in pairs(message.science_new) do
      self:UpdateOneData(v)
    end
  end
end
local UpdateOneData = function(self, message)
  if message.itemId ~= nil then
    local id = message.itemId
    local one = self:GetScienceById(id)
    if one == nil then
      one = ScienceInfo.New()
      one:UpdateInfo(message)
      self.allScience[id] = one
    else
      one:UpdateInfo(message)
    end
  end
end
local GetScienceById = function(self, id)
  return self.allScience[id]
end
local GetAllScienceOnlyRead = function(self)
  return self.allScience
end
ScienceDataManager.__init = __init
ScienceDataManager.__delete = __delete
ScienceDataManager.InitData = InitData
ScienceDataManager.UpdateOneData = UpdateOneData
ScienceDataManager.GetScienceById = GetScienceById
ScienceDataManager.GetAllScienceOnlyRead = GetAllScienceOnlyRead
return ScienceDataManager
