@@ -178,7 +178,7 @@ protected StatisticDataViewModel GetOrAddStatisticDataViewModel(PlayerStatistics
178178
179179 var playerInfoDict = _dataSourceEngine . GetPlayerInfoDictionary ( ) ;
180180 var ret = playerInfoDict . TryGetValue ( playerStats . Uid , out var playerInfo ) ;
181- slot = new StatisticDataViewModel ( _debugFunctions , _localizationManager , FetchSkillList )
181+ slot = new StatisticDataViewModel ( _debugFunctions , _localizationManager , playerStats )
182182 {
183183 Index = 999 ,
184184 Value = 0 ,
@@ -205,24 +205,7 @@ protected StatisticDataViewModel GetOrAddStatisticDataViewModel(PlayerStatistics
205205 return slot ;
206206 }
207207
208- private SkillViewModelCollection FetchSkillList ( long playerUid )
209- {
210- var data = _dataSourceEngine . CurrentSource . GetRawData ( ) ;
211- var found = data . TryGetValue ( playerUid , out var value ) ;
212-
213- Debug . Assert ( found , $ "PlayerNotFound with { playerUid } ") ;
214- Debug . Assert ( value != null , nameof ( value ) + " != null" ) ;
215- if ( ! found )
216- {
217- _logger . LogWarning ( "Player not found with {playerUid}" , playerUid ) ;
218- return SkillViewModelCollection . Empty ;
219- }
220-
221- var list = value . ToSkillItemVmList ( _localizationManager ) ;
222- return list ;
223- }
224-
225- private void UpdatePlayerInfo ( StatisticDataViewModel slot , PlayerInfo ? playerInfo )
208+ private static void UpdatePlayerInfo ( StatisticDataViewModel slot , PlayerInfo ? playerInfo )
226209 {
227210 if ( playerInfo != null )
228211 {
@@ -304,6 +287,7 @@ internal void UpdateDataOptimized(Dictionary<long, DpsDataProcessed> processedDa
304287 slot . Value = processed . Value ;
305288 slot . DurationTicks = processed . DurationTicks ;
306289 slot . ValuePerSecond = processed . ValuePerSecond ;
290+ slot . OriginalData = processed . OriginalData ;
307291
308292 // Set current player slot if this is the current player
309293 if ( hasCurrentPlayer && uid == currentPlayerUid )
@@ -358,14 +342,15 @@ private void UpdateItemIndices()
358342 public void AddTestItem ( )
359343 {
360344 var slots = Data ;
361- var newItem = new StatisticDataViewModel ( _debugFunctions , _localizationManager , FetchSkillListFunc )
345+ var uid = Random . Shared . Next ( 100 , 999 ) ;
346+ var newItem = new StatisticDataViewModel ( _debugFunctions , _localizationManager , new PlayerStatistics ( uid ) )
362347 {
363348 Index = slots . Count + 1 ,
364349 Value = ( ulong ) Random . Shared . Next ( 100 , 2000 ) ,
365350 DurationTicks = 60000 ,
366351 Player = new PlayerInfoViewModel ( LocalizationManager . Instance )
367352 {
368- Uid = Random . Shared . Next ( 100 , 999 ) ,
353+ Uid = uid ,
369354 Class = RandomClass ( ) ,
370355 Guild = "Test Guild" ,
371356 Name = $ "Test Player { slots . Count + 1 } ",
@@ -449,14 +434,6 @@ public void AddTestItem()
449434 slots . Add ( newItem ) ;
450435 SortSlotsInPlace ( ) ;
451436 return ;
452-
453- static SkillViewModelCollection FetchSkillListFunc ( long uid )
454- {
455- List < SkillItemViewModel > damage = [ new ( ) ] ;
456- List < SkillItemViewModel > healing = [ new ( ) ] ;
457- List < SkillItemViewModel > taken = [ new ( ) ] ;
458- return new SkillViewModelCollection ( damage , healing , taken ) ;
459- }
460437 }
461438
462439 private Classes RandomClass ( )
0 commit comments