PGRData/Script/matrix/xentity/xweekchallenge/XWeekChallengeInfo.lua

37 lines
890 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---@class XWeekChallengeInfo@周挑战任务
local XWeekChallengeInfo = XClass(nil, "XWeekChallengeInfo")
function XWeekChallengeInfo:Ctor()
self._ActivityId = 1
self._ReceiveRewards = {}
end
function XWeekChallengeInfo:UpdateData(data)
self:SetActivityId(data.ActId)
local list = data.RecvProgress
self._ReceiveRewards = {}
for i = 1, #list do
self:SetRewardReceived(list[i])
end
end
function XWeekChallengeInfo:SetActivityId(id)
self._ActivityId = id
-- 不发布事件不考虑更新ui
end
function XWeekChallengeInfo:GetActivityId()
return self._ActivityId
end
function XWeekChallengeInfo:SetRewardReceived(taskCount)
if taskCount then
self._ReceiveRewards[taskCount] = true
end
end
function XWeekChallengeInfo:IsRewardReceived(taskCount)
return self._ReceiveRewards[taskCount]
end
return XWeekChallengeInfo