local this = {}

function this:refreshMountData()
  local mountPetGuid = L_PlayerStore:getPlayerMount()
  if not mountPetGuid or mountPetGuid <= 0 then
    return
  end
  local mountEntityId = self.playerUnit:getMountEntityId()
  if not mountEntityId then
    return
  end
  local newPetAttrInfos = L_PetStore:getBattleStructPropertyNew(mountPetGuid)
  C_EntityManager.RefreshPetEntity(mountEntityId, newPetAttrInfos)
end

function this:refreshPetEntityData(petGuid)
  local entityId = L_PetStore:getPetEntityId(petGuid)
  if not entityId then
    return
  end
  local newPetAttrInfos = L_PetStore:getBattleStructPropertyNew(petGuid)
  local skillInfo = L_PetStore:getPetSkillInfo(petGuid)
  C_EntityManager.RefreshPetEntity(entityId, newPetAttrInfos)
  C_EntityManager.RefreshPetSkillInfo(entityId, skillInfo)
end

function this:refreshPetEntityLevel(petGuid)
  local entityId = L_PetStore:getPetEntityId(petGuid)
  if not entityId then
    return
  end
  local petItem = L_PetStore:getPetItem(petGuid)
  C_EntityManager.RefreshPetEntity(entityId, petItem:petLv())
end

function this:refreshPetEntityFlashParam(petGuid)
  local entityId = L_PetStore:getPetEntityId(petGuid)
  if not entityId then
    return
  end
  local petItem = L_PetStore:getPetItem(petGuid)
  C_EntityManager.RefreshPetEntity(entityId, petItem:hasFlashGene())
end

return this
