do to formatters

This commit is contained in:
2026-01-24 01:07:43 +01:00
parent ae59df61eb
commit 891b3cf0ee
140 changed files with 656 additions and 1159 deletions

View File

@@ -1,9 +1,9 @@
import { ViewModel } from "../contracts/view-models/ViewModel";
import { RatingTrendFormatter } from "../formatters/RatingTrendFormatter";
import { SkillLevelFormatter } from "../formatters/SkillLevelFormatter";
import { SkillLevelIconFormatter } from "../formatters/SkillLevelIconFormatter";
import { WinRateFormatter } from "../formatters/WinRateFormatter";
import type { LeaderboardDriverItem } from '../view-data/LeaderboardDriverItem';
import { SkillLevelDisplay } from "../display-objects/SkillLevelDisplay";
import { SkillLevelIconDisplay } from "../display-objects/SkillLevelIconDisplay";
import { WinRateDisplay } from "../display-objects/WinRateDisplay";
import { RatingTrendDisplay } from "../display-objects/RatingTrendDisplay";
export class DriverLeaderboardItemViewModel extends ViewModel {
private readonly data: LeaderboardDriverItem;
@@ -29,12 +29,12 @@ export class DriverLeaderboardItemViewModel extends ViewModel {
/** UI-specific: Skill level color */
get skillLevelColor(): string {
return SkillLevelDisplay.getColor(this.skillLevel);
return SkillLevelFormatter.getColor(this.skillLevel);
}
/** UI-specific: Skill level icon */
get skillLevelIcon(): string {
return SkillLevelIconDisplay.getIcon(this.skillLevel);
return SkillLevelIconFormatter.getIcon(this.skillLevel);
}
/** UI-specific: Win rate */
@@ -44,17 +44,17 @@ export class DriverLeaderboardItemViewModel extends ViewModel {
/** UI-specific: Formatted win rate */
get winRateFormatted(): string {
return WinRateDisplay.format(this.winRate);
return WinRateFormatter.format(this.winRate);
}
/** UI-specific: Rating trend */
get ratingTrend(): 'up' | 'down' | 'same' {
return RatingTrendDisplay.getTrend(this.rating, this.previousRating);
return RatingTrendFormatter.getTrend(this.rating, this.previousRating);
}
/** UI-specific: Rating change indicator */
get ratingChangeIndicator(): string {
return RatingTrendDisplay.getChangeIndicator(this.rating, this.previousRating);
return RatingTrendFormatter.getChangeIndicator(this.rating, this.previousRating);
}
/** UI-specific: Position badge */