import { Reward } from './Reward' ; export interface PlanetaryTrack { spaces : Array < PlanetaryTrackSpace > ; } export interface PlanetaryTrackSpace { everyone : Array < Reward > ; risingPlayer : Array < Reward > ; mostTags : Array < Reward > ; } export class TrackBuilder { private spaces : Array < PlanetaryTrackSpace > ; private currentSpace : number ; public constructor ( size ) { this . spaces = [ ] ; for ( let idx = 0 ; idx <= size ; idx ++ ) { this . spaces . push ( { risingPlayer : [ ] , everyone : [ ] , mostTags : [ ] , } ) ; } this . currentSpace = 0 ; } public at ( space ) { this . currentSpace = space ; return this ; } public everyone ( ... rewards ) { this . spaces [ this . currentSpace ] . everyone = rewards ; return this ; } public risingPlayer ( ... rewards ) { this . spaces [ this . currentSpace ] . risingPlayer = rewards ; return this ; } public mostTags ( ... rewards ) { this . spaces [ this . currentSpace ] . mostTags = rewards ; return this ; } public build ( ) { return { spaces : this . spaces , } ; } }