Skip to content

Commit

Permalink
Remove the Moon tag when the Moon expansion isn't in play.
Browse files Browse the repository at this point in the history
  • Loading branch information
kberg committed Jan 14, 2021
1 parent b3ffa9c commit b1e04f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/overview/PlayerTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const PlayerTags = Vue.component('player-tags', {
showVenus: function(): boolean {
return this.player.venusNextExtension;
},
showMoon: function(): boolean {
return this.player.moonExpansion;
},
getTagsPlaceholders: function() {
const tags: {[x: string]: Tags | SpecialTags} = {...Tags, ...SpecialTags};
if (this.showColonyCount() === false) {
Expand All @@ -43,6 +46,9 @@ export const PlayerTags = Vue.component('player-tags', {
if (this.showVenus() === false) {
delete tags.VENUS;
}
if (this.showMoon() === false) {
delete tags.MOON;
}
return tags;
},
getCardCount: function(): number {
Expand Down
1 change: 1 addition & 0 deletions src/models/PlayerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface PlayerModel {
megaCredits: number;
megaCreditProduction: number;
milestones: Array<ClaimedMilestoneModel>;
moonExpansion: boolean;
name: string;
oceans: number;
oxygenLevel: number;
Expand Down
2 changes: 2 additions & 0 deletions src/server/ServerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class Server {
id: player.id,
megaCredits: player.megaCredits,
megaCreditProduction: player.getProduction(Resources.MEGACREDITS),
moonExpansion: game.gameOptions.moonExpansion,
name: player.name,
oceans: game.board.getOceansOnBoard(),
oxygenLevel: game.getOxygenLevel(),
Expand Down Expand Up @@ -394,6 +395,7 @@ function getPlayers(players: Array<Player>, game: Game): Array<PlayerModel> {
victoryPointsBreakdown: player.getVictoryPoints(game),
isActive: player.id === game.activePlayer,
venusNextExtension: game.gameOptions.venusNextExtension,
moonExpansion: game.gameOptions.moonExpansion,
turmoilExtension: game.gameOptions.turmoilExtension,
venusScaleLevel: game.getVenusScaleLevel(),
boardName: game.gameOptions.boardName,
Expand Down

0 comments on commit b1e04f9

Please sign in to comment.