minor tweaks for ui/game types
This commit is contained in:
parent
9e6c28c742
commit
bd55f85fe2
|
@ -52,14 +52,14 @@ export function resignable(data: Data): boolean {
|
|||
|
||||
// can the current player go berserk?
|
||||
export function berserkableBy(data: Data): boolean {
|
||||
return data.tournament &&
|
||||
return !!data.tournament &&
|
||||
data.tournament.berserkable &&
|
||||
isPlayerPlaying(data) &&
|
||||
!bothPlayersHavePlayed(data);
|
||||
}
|
||||
|
||||
export function moretimeable(data: Data): boolean {
|
||||
return data.clock && isPlayerPlaying(data) && !mandatory(data);
|
||||
return !!data.clock && isPlayerPlaying(data) && !mandatory(data);
|
||||
}
|
||||
|
||||
export function imported(data: Data): boolean {
|
||||
|
|
|
@ -3,10 +3,10 @@ export interface Data {
|
|||
player: Player;
|
||||
opponent: Player;
|
||||
spectator: boolean;
|
||||
tournament: Tournament;
|
||||
simul: Simul;
|
||||
tournament?: Tournament;
|
||||
simul?: Simul;
|
||||
takebackable: boolean;
|
||||
clock: Clock;
|
||||
clock?: Clock;
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
|
@ -30,7 +30,7 @@ export type StatusName = 'started' | 'aborted' | 'mate' | 'resign' |
|
|||
'stalemate' | 'timeout' | 'draw' | 'outoftime' |
|
||||
'noStart' | 'cheat' | 'variantEnd';
|
||||
|
||||
export type StatusId = 0;
|
||||
export type StatusId = number;
|
||||
|
||||
export interface Player {
|
||||
id: string;
|
||||
|
|
Loading…
Reference in a new issue