local ActMigrationMyData = BaseClass("ActMigrationMyData")
local ActMigrationPlayerData = require("DataCenter.ActMigrationManager.ActMigrationPlayerData")

function ActMigrationMyData:__init()
  self.serverId = 0
  self.applyState = 0
  self.applyMessage = ""
  self.score = 0
  self.identity = ActMigrationIdentity.Low
  self.approverInfo = nil
  self.approveTime = 0
  self.migrated = 0
  self.shareCdTime = 0
  self.mailUuid = ""
  self.applyRedNum = 0
end

function ActMigrationMyData:__delete()
  self.serverId = 0
  self.applyState = 0
  self.applyMessage = ""
  self.score = 0
  self.identity = ActMigrationIdentity.Low
  self.approverInfo = nil
  self.approveTime = 0
  self.migrated = 0
  self.shareCdTime = 0
  self.mailUuid = ""
  self.applyRedNum = 0
end

function ActMigrationMyData:ParseData(t)
  if t == nil then
    return
  end
  if t.serverId then
    self.serverId = t.serverId
  end
  if t.applyState then
    self.applyState = t.applyState
  end
  local approverInfo = t.approverInfo
  if approverInfo then
    if self.approverInfo == nil then
      self.approverInfo = ActMigrationPlayerData.New()
    end
    self.approverInfo:ParseData(approverInfo)
  end
  if t.applyMessage then
    self.applyMessage = t.applyMessage
  end
  if t.score then
    self.score = t.score
  end
  if t.identity then
    self.identity = t.identity
  end
  if t.approveTime then
    self.approveTime = t.approveTime
  end
  if t.migrated then
    self.migrated = t.migrated
  end
  if t.shareCdTime then
    self.shareCdTime = t.shareCdTime
  end
  if t.mailUuid then
    self.mailUuid = t.mailUuid
  end
  if t.applyRedNum then
    self.applyRedNum = t.applyRedNum
  end
end

return ActMigrationMyData
