Skip to content

Commit

Permalink
Switch MareSerenitatisMine to use the abstract Card.
Browse files Browse the repository at this point in the history
  • Loading branch information
kberg committed Jan 14, 2021
1 parent cf0e89c commit e6295a8
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions src/cards/moon/MareSerenitatisMine.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
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';
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) {
Expand All @@ -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();
}),
};
}

0 comments on commit e6295a8

Please sign in to comment.