From df90cfb52bc9e492356352703e22d7c034b264aa Mon Sep 17 00:00:00 2001 From: ryo-ma Date: Mon, 24 Aug 2020 23:07:36 +0900 Subject: [PATCH] Fix to call setRank --- src/trophies.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/trophies.ts b/src/trophies.ts index 74dee7d..0af78bd 100644 --- a/src/trophies.ts +++ b/src/trophies.ts @@ -6,9 +6,6 @@ export abstract class Trophy { topMessage = "Unknown"; bottomMessage = "+0"; title = ""; - constructor() { - this.setRank(); - } abstract setRank(): void; render(x = 0, y = 0, panelSize = CONSTANTS.DEFALT_PANEL_SIZE): string { return ` @@ -44,6 +41,7 @@ export class TotalStarTrophy extends Trophy { constructor(private score: number) { super(); this.title = "Star"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score); @@ -67,6 +65,7 @@ export class TotalCommitTrophy extends Trophy { constructor(private score: number) { super(); this.title = "Commit"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score); @@ -90,6 +89,7 @@ export class TotalFollowerTrophy extends Trophy { constructor(private score: number) { super(); this.title = "Follower"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score); @@ -112,6 +112,7 @@ export class TotalIssueTrophy extends Trophy { constructor(private score: number) { super(); this.title = "Issue"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score); @@ -135,6 +136,7 @@ export class TotalPullRequestTrophy extends Trophy { constructor(private score: number) { super(); this.title = "PR"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score); @@ -158,6 +160,7 @@ export class TotalRepositoryTrophy extends Trophy { constructor(private score: number) { super(); this.title = "Repo"; + this.setRank(); } setRank() { this.bottomMessage = abridgeScore(this.score);