-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix card age duration display - add debug mode - improve intro, setup and difficulty level descriptions - persist tech card drafting
- Loading branch information
1 parent
67083e0
commit cd41012
Showing
14 changed files
with
171 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template> | ||
<div class="mt-4" v-if="state.setup.debugMode"> | ||
<hr/> | ||
<p class="debug"> | ||
<b>draftingRow</b>: <span v-html="getCardDeckInfo(draftingRow)"></span><br/> | ||
<b>draftingPriority</b>: <span v-html="getCardDeckInfo(draftingPriority)"></span><br/> | ||
<b>construction</b>: <span v-html="getCardDeckInfo(construction)"></span><br/> | ||
<b>war</b>: <span v-html="getCardDeckInfo(war)"></span><br/> | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useStateStore } from '@/store/state' | ||
import CardDeck from '@/services/CardDeck' | ||
import Card from '@/services/Card' | ||
import NavigationState from '@/util/NavigationState' | ||
import DraftingRowCard from '@/services/DraftingRowCard' | ||
import DraftingPriorityCard from '@/services/DraftingPriorityCard' | ||
import ConstructionCard from '@/services/ConstructionCard' | ||
import WarCard from '@/services/WarCard' | ||
export default defineComponent({ | ||
name: 'DebugInfo', | ||
setup() { | ||
const state = useStateStore() | ||
return { state } | ||
}, | ||
props: { | ||
navigationState: { | ||
type: NavigationState, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
draftingRow() : CardDeck<DraftingRowCard> { | ||
return this.navigationState.botCards.draftingRow | ||
}, | ||
draftingPriority() : CardDeck<DraftingPriorityCard> { | ||
return this.navigationState.botCards.draftingPriority | ||
}, | ||
construction() : CardDeck<ConstructionCard> { | ||
return this.navigationState.botCards.construction | ||
}, | ||
war() : CardDeck<WarCard> { | ||
return this.navigationState.botCards.war | ||
} | ||
}, | ||
methods: { | ||
getCardDeckInfo(deck: CardDeck<Card>) : string { | ||
return `<i>pile</i>: ${deck.pile.map(this.getCardInfo)}, <i>discard</i>: ${deck.discard.map(this.getCardInfo)}` | ||
}, | ||
getCardInfo(card: any) : string { // eslint-disable-line @typescript-eslint/no-explicit-any | ||
return '{' + Object.keys(card) | ||
.filter(key => key !== 'id') | ||
.map(key => `${key}: ${card[key]}`) | ||
.join(',') + '}' | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.debug { | ||
font-size: small; | ||
} | ||
p.debug, ul.debug { | ||
margin: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.