From e6295a81c4d5ef7b2ec1a1237c41ed4b28acb965 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Wed, 13 Jan 2021 22:41:42 -0500 Subject: [PATCH] Switch MareSerenitatisMine to use the abstract Card. --- src/cards/moon/MareSerenitatisMine.ts | 41 +++++++++++++++------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/cards/moon/MareSerenitatisMine.ts b/src/cards/moon/MareSerenitatisMine.ts index d9d74c5b82..e39545da5b 100644 --- a/src/cards/moon/MareSerenitatisMine.ts +++ b/src/cards/moon/MareSerenitatisMine.ts @@ -1,9 +1,7 @@ import {CardName} from '../../CardName'; import {Player} from '../../Player'; import {CardType} from '../CardType'; -import {IProjectCard} from '../IProjectCard'; import {Tags} from '../Tags'; -import {CardMetadata} from '../CardMetadata'; import {CardRenderer} from '../render/CardRenderer'; import {Resources} from '../../Resources'; import {MoonSpaces} from '../../moon/MoonSpaces'; @@ -11,12 +9,30 @@ import {MoonExpansion} from '../../moon/MoonExpansion'; import {PlaceMoonRoadTile} from '../../moon/PlaceMoonRoadTile'; import {Units} from '../../Units'; import {SpaceType} from '../../SpaceType'; +import {IProjectCard} from '../IProjectCard'; +import {Card} from '../Card'; + +export class MareSerenitatisMine extends Card implements IProjectCard { + constructor() { + super({ + name: CardName.MARE_SERENITATIS_MINE, + cardType: CardType.AUTOMATED, + tags: [Tags.MOON, Tags.BUILDING], + cost: 21, + + metadata: { + description: 'Spend 2 titanium and 1 steel. Increase your steel production 1 step and your titanium production 1 step. ' + + 'Place a mine ON THE RESERVED AREA and adjacent to it road tile. Raise Mining Rate 1 step and Logistic Rate 1 step.', + cardNumber: 'M04', + renderData: CardRenderer.builder((b) => { + b.minus().titanium(2).minus().steel(1).br; + b.production((pb) => pb.steel(1).titanium(1)).br; + b.moonMine().asterix().nbsp.moonRoad().asterix(); + }), + }, + }); + } -export class MareSerenitatisMine implements IProjectCard { - public cost = 21; - public tags = [Tags.MOON, Tags.BUILDING]; - public cardType = CardType.AUTOMATED; - public name = CardName.MARE_SERENITATIS_MINE; public reserveUnits = Units.of({titanium: 2, steel: 1}); public play(player: Player) { @@ -33,15 +49,4 @@ export class MareSerenitatisMine implements IProjectCard { player.game.defer(new PlaceMoonRoadTile(player, 'Select a space next to Mare Serintatis to play a road', availableRoadSpaces)); return undefined; } - - public readonly metadata: CardMetadata = { - description: 'Spend 2 titanium and 1 steel. Increase your steel production 1 step and your titanium production 1 step. ' + - 'Place a mine ON THE RESERVED AREA and adjacent to it road tile. Raise Mining Rate 1 step and Logistic Rate 1 step.', - cardNumber: 'M04', - renderData: CardRenderer.builder((b) => { - b.minus().titanium(2).minus().steel(1).br; - b.production((pb) => pb.steel(1).titanium(1)).br; - b.moonMine().asterix().nbsp.moonRoad().asterix(); - }), - }; }