From 5daa94b9ad4cc8d131e681a2d8ea9a7b118c6a9c Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 13 Sep 2019 17:55:41 +0200 Subject: [PATCH] Refactor draft options --- src/mlpccg/draft/types.ts | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/mlpccg/draft/types.ts b/src/mlpccg/draft/types.ts index 58f4ae7..3306bd6 100644 --- a/src/mlpccg/draft/types.ts +++ b/src/mlpccg/draft/types.ts @@ -20,27 +20,46 @@ export interface AlternateProvider { } export interface SetDraftOptions { - type: "set"; + source: "set"; set: string; } export interface BlockDraftOptions { - type: "block"; + source: "block"; block: string; } export interface CubeDraftOptions { - type: "cube"; + source: "cube"; url: string; } export interface I8PCubeDraftOptions { - type: "i8pcube"; + source: "i8pcube"; url: string; } -export type DraftOptions = +export interface LimitedBoosterDraft { + type: "booster-draft"; + packs: number; +} + +export interface LimitedSealedDraft { + type: "sealed"; + packs: number; +} + +export type LimitedGameType = LimitedBoosterDraft | LimitedSealedDraft; + +export type DraftType = | SetDraftOptions | BlockDraftOptions | CubeDraftOptions | I8PCubeDraftOptions; + +export interface SessionOptions { + players: number; + spacing: "evenly" | "randomly"; +} + +export type DraftOptions = SessionOptions & LimitedGameType & DraftType;