Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
fix(model): a few cleanups to game handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 11, 2020
1 parent 23846ea commit b588da9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/app/diamond/diamond.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { APIDatabase } from '../../lib/api/database';
import { Team } from '../../lib/model/team';

import { TeamPage } from '../team-page/team-page.page';
import { Game } from 'src/lib/model/game';

// import Positions from '../../lib/model/positions';
// import Player from '../../lib/model/player';
Expand All @@ -17,7 +18,7 @@ import { TeamPage } from '../team-page/team-page.page';
styleUrls: ['./diamond.component.scss'],
})
export class DiamondComponent implements OnInit {
@Input() public game: any;
@Input() public game: Game;
@Output("refresh") public refresh: EventEmitter<any> = new EventEmitter();

public font = {
Expand Down Expand Up @@ -117,9 +118,9 @@ export class DiamondComponent implements OnInit {
getEmoji(type: string) {
switch(type) {
case 'home':
return String.fromCodePoint(this.game.homeTeamEmoji);
return String.fromCodePoint(parseInt(this.game.homeTeamEmoji, 16));
case 'away':
return String.fromCodePoint(this.game.awayTeamEmoji);
return String.fromCodePoint(parseInt(this.game.awayTeamEmoji, 16));
default:
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/model/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Game extends Entry {
return this.data?.baseRunners || [];
}

public get basesOccupied(): string[] {
public get basesOccupied(): number[] {
return this.data?.basesOccupied || [];
}

Expand Down

0 comments on commit b588da9

Please sign in to comment.