This repository was archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
888034a
commit 9d95310
Showing
7 changed files
with
47 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import { uniq } from "lodash"; | ||
|
||
import { PlayerId } from "./Player"; | ||
|
||
export type Team = [PlayerId, PlayerId]; | ||
export type GameId = string; | ||
type Timestamp = number; | ||
|
||
export class Game implements IGame { | ||
constructor( | ||
public readonly id: GameId, | ||
public readonly createdAt: Date, | ||
public readonly winnerTeam: Team, | ||
public readonly loserTeam: Team | ||
) { | ||
if (uniq([...winnerTeam, ...loserTeam]).length !== 4) { | ||
throw new Error("There must be four unique players."); | ||
} | ||
} | ||
} | ||
|
||
export interface IGame { | ||
export interface Game { | ||
id: GameId; | ||
createdAt: Date; | ||
createdAt: Timestamp; | ||
winnerTeam: Team; | ||
loserTeam: Team; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9d95310
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kicker-tracker – ./
thanks-for-playing.com
kicker-tracker-git-master-jonathan-wbn.vercel.app
www.thanks-for-playing.com
kicker-tracker-jonathan-wbn.vercel.app
kicker-tracker.vercel.app