Fix to call setRank

This commit is contained in:
ryo-ma 2020-08-24 23:07:36 +09:00
parent 52ccc94bb6
commit df90cfb52b

View file

@ -6,9 +6,6 @@ export abstract class Trophy {
topMessage = "Unknown"; topMessage = "Unknown";
bottomMessage = "+0"; bottomMessage = "+0";
title = ""; title = "";
constructor() {
this.setRank();
}
abstract setRank(): void; abstract setRank(): void;
render(x = 0, y = 0, panelSize = CONSTANTS.DEFALT_PANEL_SIZE): string { render(x = 0, y = 0, panelSize = CONSTANTS.DEFALT_PANEL_SIZE): string {
return ` return `
@ -44,6 +41,7 @@ export class TotalStarTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "Star"; this.title = "Star";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);
@ -67,6 +65,7 @@ export class TotalCommitTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "Commit"; this.title = "Commit";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);
@ -90,6 +89,7 @@ export class TotalFollowerTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "Follower"; this.title = "Follower";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);
@ -112,6 +112,7 @@ export class TotalIssueTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "Issue"; this.title = "Issue";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);
@ -135,6 +136,7 @@ export class TotalPullRequestTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "PR"; this.title = "PR";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);
@ -158,6 +160,7 @@ export class TotalRepositoryTrophy extends Trophy {
constructor(private score: number) { constructor(private score: number) {
super(); super();
this.title = "Repo"; this.title = "Repo";
this.setRank();
} }
setRank() { setRank() {
this.bottomMessage = abridgeScore(this.score); this.bottomMessage = abridgeScore(this.score);