import { Boon } from "./boon" ; import { SupplyCard } from "./supply-card" ; import { Event } from "./event" ; import { Landmark } from "./landmark" ; import { Project } from "./project" ; import { SetId } from "./set-id" ; import { Way } from "./way" ; export class DominionSet { constructor ( readonly setId , readonly name , readonly supplyCards , readonly events , readonly landmarks , readonly projects , readonly boons , readonly ways ) { } public static fromJson ( json ) { return new DominionSet ( json [ "id" ] , json [ "name" ] , ( json [ "cards" ] || [ ] ) . map ( SupplyCard . fromJson ) , ( json [ "events" ] || [ ] ) . map ( Event . fromJson ) , ( json [ "landmarks" ] || [ ] ) . map ( Landmark . fromJson ) , ( json [ "projects" ] || [ ] ) . map ( Project . fromJson ) , ( json [ "boons" ] || [ ] ) . map ( Boon . fromJson ) , ( json [ "ways" ] || [ ] ) . map ( Way . fromJson ) ) ; } }