Back to Home

ESO Lua File v101038

ingame/champion/championdatamanager.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
ZO_ChampionSkillData = ZO_InitializingObject:Subclass()
function ZO_ChampionSkillData:Initialize(disciplineData, championSkillIndex)
    self.championDisciplineData = disciplineData
    self.championSkillIndex = championSkillIndex
    self.championSkillId = GetChampionSkillId(disciplineData:GetDisciplineIndex(), championSkillIndex)
    self.pendingPoints = self:GetNumSavedPoints()
end
function ZO_ChampionSkillData:LinkData()
    local links = {}
    local skillIds = { GetChampionSkillLinkIds(self.championSkillId) }
    for _, skillId in ipairs(skillIds) do
        local championSkillData = CHAMPION_DATA_MANAGER:GetChampionSkillData(skillId)
        internalassert(championSkillData, "skill data missing; can be caused by calling ZO_ChampionSkillData:LinkData() before instantiating all skills")
        table.insert(links, championSkillData)
    end
    self.linkedChampionSkillDatas = links
end
function ZO_ChampionSkillData:GetId()
    return self.championSkillId
end
function ZO_ChampionSkillData:GetSkillIndices()
    return self.championDisciplineData:GetDisciplineIndex(), self.championSkillIndex
end
function ZO_ChampionSkillData:GetAbilityId()
    return GetChampionAbilityId(self.championSkillId)
end
function ZO_ChampionSkillData:GetPosition()
    if self:IsClusterRoot() then
        local positionX, positionY = GetChampionSkillPosition(self.championSkillId)
        local offsetX, offsetY = GetChampionClusterRootOffset(self.championSkillId)
        return positionX + offsetX, positionY + offsetY
    else
        return GetChampionSkillPosition(self.championSkillId)
    end
end
function ZO_ChampionSkillData:GetPositionNoClusterOffset()
    return GetChampionSkillPosition(self.championSkillId)
end
function ZO_ChampionSkillData:IsRootNode()
    return IsChampionSkillRootNode(self.championSkillId)
end
function ZO_ChampionSkillData:GetRawName()
    return GetChampionSkillName(self.championSkillId)
end
function ZO_ChampionSkillData:GetFormattedName()
    return ZO_CachedStrFormat(SI_CHAMPION_STAR_NAME, self:GetRawName())
end
function ZO_ChampionSkillData:GetDescription()
    return GetChampionSkillDescription(self.championSkillId, self:GetNumPendingPoints())
end
function ZO_ChampionSkillData:GetCurrentBonusText()
    local bonusText = GetChampionSkillCurrentBonusText(self.championSkillId, self:GetNumPendingPoints())
    if bonusText ~= "" then
        return bonusText
    end
    return nil
end
function ZO_ChampionSkillData:GetType()
    return GetChampionSkillType(self.championSkillId)
end
function ZO_ChampionSkillData:IsClusterRoot()
    return IsChampionSkillClusterRoot(self.championSkillId)
end
function ZO_ChampionSkillData:GetNumPendingPoints()
    return self.pendingPoints
end
function ZO_ChampionSkillData:SetNumPendingPointsInternal(numPoints)
    if numPoints ~= self.pendingPoints then
        self.pendingPoints = numPoints
        return true
    end
    return false
end
function ZO_ChampionSkillData:CollectUnsavedChanges()
    if self:HasUnsavedChanges() then
        AddSkillToChampionPurchaseRequest(self.championSkillId, self.pendingPoints)
    end
end
function ZO_ChampionSkillData:SetNumPendingPoints(numPoints)
    local wasUnlocked = self:WouldBeUnlockedNode()
    if self:SetNumPendingPointsInternal(numPoints) then
        local isUnlocked = self:WouldBeUnlockedNode()
        if isUnlocked == false and wasUnlocked == true then
            -- skill has been re-locked, refund any points that are no longer attached to a root skill as a result
            if self.championDisciplineData:RefundOrphanedSkillsInternal() then
                self:GetChampionDisciplineData():DirtyNumPendingPointsInternal()
                CHAMPION_DATA_MANAGER:FireCallbacks("AllPointsChanged")
                return
            end
        end
        CHAMPION_DATA_MANAGER:FireCallbacks("ChampionSkillPendingPointsChanged", self, wasUnlocked, isUnlocked)
    end
end
function ZO_ChampionSkillData:LinkedChampionSkillDataIterator()
    return ipairs(self.linkedChampionSkillDatas)
end
function ZO_ChampionSkillData:GetNumSavedPoints()
    return GetNumPointsSpentOnChampionSkill(self.championSkillId)
end
function ZO_ChampionSkillData:WouldBeUnlockedNode()
    return WouldChampionSkillNodeBeUnlocked(self.championSkillId, self:GetNumPendingPoints())
end
function ZO_ChampionSkillData:WouldBeUnlockedNodeAtValue(pendingPoints)
    return WouldChampionSkillNodeBeUnlocked(self.championSkillId, pendingPoints)
end
function ZO_ChampionSkillData:CanBePurchased()
    if self:IsRootNode() or self:WouldBeUnlockedNode() then
        return true
    end
    for _, linkedSkillData in self:LinkedChampionSkillDataIterator() do
        if linkedSkillData:WouldBeUnlockedNode() then
            return true
        end
    end
    return false
end
function ZO_ChampionSkillData:ClearChangesInternal()
    local pendingPoints = self:GetNumSavedPoints()
    self:SetNumPendingPointsInternal(pendingPoints)
end
function ZO_ChampionSkillData:ClearAllPointsInternal()
end
function ZO_ChampionSkillData:HasUnsavedChanges()
end
function ZO_ChampionSkillData:IsRespecNeeded()
end
function ZO_ChampionSkillData:GetMinPendingPoints()
    if CHAMPION_PERKS:IsInRespecMode() then
        return 0
    else
        return self:GetNumSavedPoints()
    end
end
function ZO_ChampionSkillData:GetMaxPossiblePoints()
    return GetChampionSkillMaxPoints(self.championSkillId)
end
function ZO_ChampionSkillData:GetMaxPendingPoints()
    local pointsInPool = self.championDisciplineData:GetNumAvailablePoints()
    local pointsInSkill = self:GetNumPendingPoints()
    local maxPossiblePointsInSkill = self:GetMaxPossiblePoints()
    return zo_min(pointsInPool + pointsInSkill, maxPossiblePointsInSkill)
end
function ZO_ChampionSkillData:IsPurchased()
    return WouldChampionSkillNodeBeUnlocked(self.championSkillId, self:GetMinPendingPoints())
end
function ZO_ChampionSkillData:WouldBePurchased()
    return self:WouldBeUnlockedNode()
end
function ZO_ChampionSkillData:HasJumpPoints()
    return DoesChampionSkillHaveJumpPoints(self.championSkillId)
end
function ZO_ChampionSkillData:GetJumpPoints()
    if not self.jumpPoints then
        self.jumpPoints = {GetChampionSkillJumpPoints(self.championSkillId)}
    end
    return self.jumpPoints
end
function ZO_ChampionSkillData:GetNextJumpPoint(pointValue)
    local max = self:GetMaxPossiblePoints()
    if self:HasJumpPoints() then
        local jumpPoints = self:GetJumpPoints()
        local lastJumpPoint = 0
        for _, jumpPoint in ipairs(jumpPoints) do
            if jumpPoint > pointValue then
                return zo_min(max, jumpPoint)
            end
            lastJumpPoint = jumpPoint
        end
        return zo_min(max, lastJumpPoint)
    end
    return zo_min(max, pointValue + 1)
end
function ZO_ChampionSkillData:GetPreviousJumpPoint(pointValue)
    local min = 0
    if self:HasJumpPoints() then
        local jumpPoints = self:GetJumpPoints()
        local lastJumpPoint = 0
        for _, jumpPoint in ZO_NumericallyIndexedTableReverseIterator(jumpPoints) do
            if jumpPoint < pointValue then
                return zo_max(min, jumpPoint)
            end
            lastJumpPoint = jumpPoint
        end
        return zo_max(min, lastJumpPoint)
    end
    return zo_max(min, pointValue - 1)
end
function ZO_ChampionSkillData:GetJumpPointForValue(pointValue)
    if self:HasJumpPoints() then
        local jumpPoints = self:GetJumpPoints()
        local lastJumpPoint = 0
        for _, jumpPoint in ipairs(jumpPoints) do
            if jumpPoint > pointValue then
                return lastJumpPoint
            end
            lastJumpPoint = jumpPoint
        end
        return lastJumpPoint
    end
    return pointValue
end
function ZO_ChampionSkillData:SetClusterDataInternal(championClusterData)
    self.championClusterData = championClusterData
end
function ZO_ChampionSkillData:IsPartOfCluster()
    return self.championClusterData ~= nil
end
function ZO_ChampionSkillData:GetChampionClusterData()
    return self.championClusterData
end
function ZO_ChampionSkillData:GetChampionDisciplineData()
    return self.championDisciplineData
end
function ZO_ChampionSkillData:IsTypeSlottable()
end
function ZO_ChampionSkillData:CanBeSlotted()
    return self:IsTypeSlottable() and self:WouldBePurchased()
end
function ZO_ChampionSkillData:TryCursorPickup()
    if self:CanBeSlotted() then
        PickupChampionSkillById(self.championSkillId)
        return true
    end
    return false
end
ZO_ChampionClusterData = ZO_InitializingObject:Subclass()
function ZO_ChampionClusterData:Initialize(rootChampionSkillData)
    self.rootChampionSkillData = rootChampionSkillData
    self.rootDisciplineIndex, self.rootChampionSkillIndex = rootChampionSkillData:GetSkillIndices()
end
function ZO_ChampionClusterData:LinkData()
    local clusterChildren = { self.rootChampionSkillData }
    self.rootChampionSkillData:SetClusterDataInternal(self)
    local skillIds = { GetChampionClusterSkillIds(self.rootChampionSkillData:GetId()) }
    for _, skillId in ipairs(skillIds) do
        local championSkillData = CHAMPION_DATA_MANAGER:GetChampionSkillData(skillId)
        if not championSkillData then
            internalassert(false, string.format("Missing data for skill %d; used in the cluster group with root id %d. Is this skill connected to the cluster root?", skillId, self.rootChampionSkillData:GetId()))
        end
        table.insert(clusterChildren, championSkillData)
        championSkillData:SetClusterDataInternal(self)
    end
    self.clusterChildren = clusterChildren
end
function ZO_ChampionClusterData:GetClusterChildren()
    return self.clusterChildren
end
function ZO_ChampionClusterData:GetRootChampionSkillData()
    return self.rootChampionSkillData
end
function ZO_ChampionClusterData:GetFormattedName()
    return ZO_CachedStrFormat(SI_CHAMPION_CLUSTER_NAME, GetChampionClusterName(self.rootChampionSkillData:GetId()))
end
function ZO_ChampionClusterData:GetBackgroundTexture()
    return GetChampionClusterBackgroundTexture(self.rootChampionSkillData:GetId())
end
function ZO_ChampionClusterData:DoChildrenHaveUnsavedChanges()
    for _, childSkillData in ipairs(self.clusterChildren) do
        if childSkillData:HasUnsavedChanges() then
            return true
        end
    end
    return false
end
function ZO_ChampionClusterData:CalculateTotalPendingPoints()
    local totalPendingPoints = 0
    for _, childSkillData in ipairs(self.clusterChildren) do
        totalPendingPoints = totalPendingPoints + childSkillData:GetNumPendingPoints()
    end
    return totalPendingPoints
end
ZO_ChampionDisciplineData = ZO_InitializingObject:Subclass()
function ZO_ChampionDisciplineData:Initialize(disciplineIndex)
    self.disciplineIndex = disciplineIndex
    self.disciplineId = GetChampionDisciplineId(disciplineIndex)
    self.championSkillDatas = {}
    self.championClusterDatas = {}
    for skillIndex = 1, GetNumChampionDisciplineSkills(disciplineIndex) do
        local championSkillData = ZO_ChampionSkillData:New(self, skillIndex)
        if championSkillData:IsClusterRoot() then
            table.insert(self.championClusterDatas, ZO_ChampionClusterData:New(championSkillData))
        end
        self.championSkillDatas[skillIndex] = championSkillData
    end
end
function ZO_ChampionDisciplineData:LinkData()
    for _, championSkillData in ipairs(self.championSkillDatas) do
        championSkillData:LinkData()
    end
    for _, championClusterData in ipairs(self.championClusterDatas) do
        championClusterData:LinkData()
    end
end
function ZO_ChampionDisciplineData:GetDisciplineIndex()
    return self.disciplineIndex
end
function ZO_ChampionDisciplineData:GetId()
    return self.disciplineId
end
function ZO_ChampionDisciplineData:ChampionSkillDataIterator(filterFunctions)
    return ZO_FilteredNumericallyIndexedTableIterator(self.championSkillDatas, filterFunctions)
end
function ZO_ChampionDisciplineData:ChampionClusterDataIterator(filterFunctions)
    return ZO_FilteredNumericallyIndexedTableIterator(self.championClusterDatas, filterFunctions)
end
function ZO_ChampionDisciplineData:GetRawName()
    return GetChampionDisciplineName(self.disciplineId)
end
function ZO_ChampionDisciplineData:GetFormattedName()
    return ZO_CachedStrFormat(SI_CHAMPION_CONSTELLATION_NAME_FORMAT, self:GetRawName())
end
function ZO_ChampionDisciplineData:GetBackgroundZoomedOutTexture()
    return GetChampionDisciplineZoomedOutBackground(self.disciplineId)
end
function ZO_ChampionDisciplineData:GetBackgroundZoomedInTexture()
    return GetChampionDisciplineZoomedInBackground(self.disciplineId)
end
function ZO_ChampionDisciplineData:GetBackgroundSelectedZoomedOutTexture()
end
function ZO_ChampionDisciplineData:GetType()
    return GetChampionDisciplineType(self.disciplineId)
end
do
    local POINTS_ATTRIBUTE_ICON =
    {
        [CHAMPION_DISCIPLINE_TYPE_WORLD] = "EsoUI/Art/Champion/champion_points_stamina_icon.dds",
        [CHAMPION_DISCIPLINE_TYPE_COMBAT] = "EsoUI/Art/Champion/champion_points_magicka_icon.dds",
        [CHAMPION_DISCIPLINE_TYPE_CONDITIONING] = "EsoUI/Art/Champion/champion_points_health_icon.dds",
    }
    function ZO_ChampionDisciplineData:GetPointPoolIcon()
        return POINTS_ATTRIBUTE_ICON[self:GetType()]
    end
end
do
    local POINTS_ATTRIBUTE_HUD_ICON =
    {
        [CHAMPION_DISCIPLINE_TYPE_WORLD] = "EsoUI/Art/Champion/champion_points_stamina_icon-HUD.dds",
        [CHAMPION_DISCIPLINE_TYPE_COMBAT] = "EsoUI/Art/Champion/champion_points_magicka_icon-HUD.dds",
        [CHAMPION_DISCIPLINE_TYPE_CONDITIONING] = "EsoUI/Art/Champion/champion_points_health_icon-HUD.dds",
    }
    function ZO_ChampionDisciplineData:GetHUDIcon()
        return POINTS_ATTRIBUTE_HUD_ICON[self:GetType()]
    end
end
function ZO_ChampionDisciplineData:GetNumSavedUnspentPoints()
    return GetNumUnspentChampionPoints(self.disciplineId)
end
function ZO_ChampionDisciplineData:GetNumSavedSpentPoints()
    return GetNumSpentChampionPoints(self.disciplineId)
end
function ZO_ChampionDisciplineData:GetNumSavedPointsTotal()
end
function ZO_ChampionDisciplineData:DirtyNumPendingPointsInternal()
    self.cachedPendingPoints = nil
end
function ZO_ChampionDisciplineData:GetOrCalculateNumPendingPoints()
    if self.cachedPendingPoints then
        return self.cachedPendingPoints
    end
    local numPendingPoints = 0
    for _, championSkillData in self:ChampionSkillDataIterator() do
        numPendingPoints = numPendingPoints + championSkillData:GetNumPendingPoints()
    end
    self.cachedPendingPoints = numPendingPoints
    return numPendingPoints
end
function ZO_ChampionDisciplineData:GetNumAvailablePoints()
end
function ZO_ChampionDisciplineData:HasAnySavedUnspentPoints()
    return self:GetNumSavedUnspentPoints() > 0
end
function ZO_ChampionDisciplineData:HasUnsavedChanges()
    for _, championSkillData in self:ChampionSkillDataIterator() do
        if championSkillData:HasUnsavedChanges() then
            return true
        end
    end
    return false
end
function ZO_ChampionDisciplineData:IsRespecNeeded()
    for _, championSkillData in self:ChampionSkillDataIterator() do
        if championSkillData:IsRespecNeeded() then
            return true
        end
    end
    return false
end
function ZO_ChampionDisciplineData:ClearChangesInternal()
    for _, championSkillData in self:ChampionSkillDataIterator() do
        championSkillData:ClearChangesInternal()
    end
end
function ZO_ChampionDisciplineData:ClearAllPointsInternal()
    for _, championSkillData in self:ChampionSkillDataIterator() do
        championSkillData:ClearAllPointsInternal()
    end
end
function ZO_ChampionDisciplineData:RefundOrphanedSkillsInternal()
    -- This is very similar to the traditional mark-sweep algorithm used in garbage collectors.
    local unvisitedNodeSet = {}
    local visitQueue = {}
    -- first, mark all non-root nodes as potential orphans
    for _, championSkillData in self:ChampionSkillDataIterator() do
        if championSkillData:IsRootNode() then
            table.insert(visitQueue, championSkillData)
        else
            unvisitedNodeSet[championSkillData] = true
        end
    end
    -- then sweep through every node linked to a root skill, using a graph search
    while not ZO_IsTableEmpty(visitQueue) do
        local championSkillData = table.remove(visitQueue)
        -- only traverse unlocked nodes. This means that if there isn't a path
        -- from the root to a given node only using the unlocked nodes, then it
        -- will never be visited
        if championSkillData:WouldBeUnlockedNode() then
            for _, linkedSkillData in championSkillData:LinkedChampionSkillDataIterator() do
                if unvisitedNodeSet[linkedSkillData] then
                    unvisitedNodeSet[linkedSkillData] = nil
                    table.insert(visitQueue, linkedSkillData)
                end
            end
        end
    end
    -- everything left over is an orphan and should be cleaned up
    local anySkillsChanged = false
    for orphanSkillData in pairs(unvisitedNodeSet) do
        if orphanSkillData:ClearAllPointsInternal() then
            anySkillsChanged = true
        end
    end
    return anySkillsChanged
end
function ZO_ChampionDisciplineData:CollectUnsavedChanges()
    for _, championSkillData in self:ChampionSkillDataIterator() do
        championSkillData:CollectUnsavedChanges()
    end
end
ZO_ChampionDataManager = ZO_InitializingCallbackObject:Subclass()
function ZO_ChampionDataManager:Initialize()
    CHAMPION_DATA_MANAGER = self
    self:RebuildData()
end
function ZO_ChampionDataManager:RebuildData()
    self.disciplineDatas = {}
    self.championSkillDataById = {}
    for disciplineIndex = 1, GetNumChampionDisciplines() do
        local disciplineData = ZO_ChampionDisciplineData:New(disciplineIndex)
        self.disciplineDatas[disciplineIndex] = disciplineData
        for _, championSkillData in disciplineData:ChampionSkillDataIterator() do
            internalassert(self.championSkillDataById[championSkillData:GetId()] == nil, "Duplicate champion skill")
            self.championSkillDataById[championSkillData:GetId()] = championSkillData
        end
        disciplineData:LinkData()
    end
    self:FireCallbacks("DataChanged")
end
function ZO_ChampionDataManager:ChampionDisciplineDataIterator(filterFunctions)
    return ZO_FilteredNumericallyIndexedTableIterator(self.disciplineDatas, filterFunctions)
end
function ZO_ChampionDataManager:FindChampionDisciplineDataById(disciplineId)
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        if disciplineData:GetId() == disciplineId then
            return disciplineData
        end
    end
    return nil
end
function ZO_ChampionDataManager:FindChampionDisciplineDataByType(disciplineType)
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        if disciplineData:GetType() == disciplineType then
            return disciplineData
        end
    end
    return nil
end
function ZO_ChampionDataManager:GetChampionSkillData(championSkillId)
    return self.championSkillDataById[championSkillId]
end
function ZO_ChampionDataManager:HasPointsToClear()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        for _, championSkillData in disciplineData:ChampionSkillDataIterator() do
            if championSkillData:GetNumPendingPoints() > championSkillData:GetMinPendingPoints() then
                return true
            end
        end
    end
    return false
end
function ZO_ChampionDataManager:HasAnySavedSpentPoints()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        for _, championSkillData in disciplineData:ChampionSkillDataIterator() do
            if championSkillData:GetNumSavedPoints() > 0 then
                return true
            end
        end
    end
    return false
end
function ZO_ChampionDataManager:HasAnySavedUnspentPoints()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        if disciplineData:HasAnySavedUnspentPoints() then
            return true
        end
    end
    return false
end
function ZO_ChampionDataManager:HasUnsavedChanges()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        if disciplineData:HasUnsavedChanges() then
            return true
        end
    end
    return false
end
function ZO_ChampionDataManager:IsRespecNeeded()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        if disciplineData:IsRespecNeeded() then
            return true
        end
    end
    return false
end
function ZO_ChampionDataManager:ClearChanges()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        disciplineData:ClearChangesInternal()
        disciplineData:DirtyNumPendingPointsInternal()
    end
    self:FireCallbacks("AllPointsChanged")
end
function ZO_ChampionDataManager:ClearAllPoints()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        disciplineData:ClearAllPointsInternal()
        disciplineData:DirtyNumPendingPointsInternal()
    end
    self:FireCallbacks("AllPointsChanged")
end
function ZO_ChampionDataManager:CollectUnsavedChanges()
    for _, disciplineData in self:ChampionDisciplineDataIterator() do
        disciplineData:CollectUnsavedChanges()
    end
end
ZO_ChampionDataManager:New()