-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d807a35
commit 20398ab
Showing
10 changed files
with
298 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<SideBar :navigationState="navigationState"/> | ||
|
||
<h1 class="mb-3">{{t('gameEnd.title')}}</h1> | ||
|
||
<p>...</p> | ||
|
||
<FooterButtons :backButtonRouteTo="backButtonRouteTo" endGameButtonType="endGame"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import FooterButtons from '@/components/structure/FooterButtons.vue' | ||
import { useRoute } from 'vue-router' | ||
import { useStateStore } from '@/store/state' | ||
import SideBar from '@/components/turn/SideBar.vue' | ||
import NavigationState from '@/util/NavigationState' | ||
export default defineComponent({ | ||
name: 'GameEnd', | ||
components: { | ||
FooterButtons, | ||
SideBar | ||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const route = useRoute() | ||
const state = useStateStore() | ||
const navigationState = new NavigationState(route, state) | ||
return { t, state, navigationState } | ||
}, | ||
computed: { | ||
backButtonRouteTo() : string { | ||
return '/round/4/end' | ||
} | ||
} | ||
}) | ||
</script> |
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,69 @@ | ||
<template> | ||
<SideBar :navigationState="navigationState"/> | ||
|
||
<h1 class="mb-3">{{t('roundEnd.title')}}</h1> | ||
|
||
<h3>5) Site phase</h3> | ||
|
||
<h3>6) Feeding phase</h3> | ||
|
||
<h3>7) Event phase</h3> | ||
|
||
<h3>8) Income phase</h3> | ||
|
||
<button class="btn btn-primary btn-lg mt-4" @click="next()"> | ||
{{t('action.next')}} | ||
</button> | ||
|
||
<FooterButtons :backButtonRouteTo="backButtonRouteTo" endGameButtonType="abortGame"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import FooterButtons from '@/components/structure/FooterButtons.vue' | ||
import { useRoute } from 'vue-router' | ||
import { useStateStore } from '@/store/state' | ||
import SideBar from '@/components/turn/SideBar.vue' | ||
import NavigationState from '@/util/NavigationState' | ||
export default defineComponent({ | ||
name: 'RoundStart', | ||
components: { | ||
FooterButtons, | ||
SideBar | ||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const route = useRoute() | ||
const state = useStateStore() | ||
const navigationState = new NavigationState(route, state) | ||
const { round } = navigationState | ||
return { t, state, navigationState, round } | ||
}, | ||
computed: { | ||
backButtonRouteTo() : string { | ||
const roundData = this.state.rounds.find(item => item.round === this.round) | ||
if (roundData) { | ||
const lastTurn = roundData.turns.toSorted((a,b) => a.turn - b.turn)[0] | ||
if (lastTurn) { | ||
return `/round/${lastTurn.round}/turn/${lastTurn.turn}/${lastTurn.player}` | ||
} | ||
} | ||
return '' | ||
} | ||
}, | ||
methods: { | ||
next() : void { | ||
if (this.round < 4) { | ||
this.$router.push(`/round/${this.round+1}/start`) | ||
} | ||
else { | ||
this.$router.push(`/gameEnd`) | ||
} | ||
} | ||
} | ||
}) | ||
</script> |
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,80 @@ | ||
<template> | ||
<SideBar :navigationState="navigationState"/> | ||
|
||
<h1 class="mb-3">{{t('roundStart.title')}}</h1> | ||
|
||
<h3 v-html="t('roundStart.newCards.title')"></h3> | ||
<p v-html="t('roundStart.newCards.playAsUsual')"></p> | ||
|
||
<h3 v-html="t('roundStart.newGoals.title')"></h3> | ||
<ol> | ||
<li v-if="isPlayerStartPlayer" v-html="t('roundStart.newGoals.playerTakeGoal')"></li> | ||
<li v-if="goalChip && goalChip > 4" v-html="t('roundStart.newGoals.botNoGoal')"></li> | ||
<li v-else-if="goalChip" v-html="t('roundStart.newGoals.botTakeGoal', {goalChip})"></li> | ||
<li v-else><button class="btn btn-sm btn-secondary" @click="determineGoalChip" v-html="t('roundStart.newGoals.botDetermine')"></button></li> | ||
<li v-if="!isPlayerStartPlayer" v-html="t('roundStart.newGoals.playerTakeGoal')"></li> | ||
</ol> | ||
|
||
<h3 v-html="t('roundStart.extraFind.title')"></h3> | ||
<p v-html="t('roundStart.extraFind.playAsUsual')"></p> | ||
|
||
<button class="btn btn-primary btn-lg mt-4" @click="next()"> | ||
{{t('action.next')}} | ||
</button> | ||
|
||
<FooterButtons :backButtonRouteTo="backButtonRouteTo" endGameButtonType="abortGame"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import FooterButtons from '@/components/structure/FooterButtons.vue' | ||
import { useRoute } from 'vue-router' | ||
import { useStateStore } from '@/store/state' | ||
import SideBar from '@/components/turn/SideBar.vue' | ||
import NavigationState from '@/util/NavigationState' | ||
import rollDice from '@brdgm/brdgm-commons/src/util/random/rollDice' | ||
import Player from '@/services/enum/Player' | ||
export default defineComponent({ | ||
name: 'RoundStart', | ||
components: { | ||
FooterButtons, | ||
SideBar | ||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const route = useRoute() | ||
const state = useStateStore() | ||
const navigationState = new NavigationState(route, state) | ||
const { round, startPlayer } = navigationState | ||
return { t, state, navigationState, round, startPlayer } | ||
}, | ||
data() { | ||
return { | ||
goalChip: undefined as number|undefined | ||
} | ||
}, | ||
computed: { | ||
backButtonRouteTo() : string { | ||
if (this.round > 1) { | ||
return `/round/${this.round-1}/end` | ||
} | ||
return '' | ||
}, | ||
isPlayerStartPlayer() : boolean { | ||
return this.startPlayer == Player.PLAYER | ||
} | ||
}, | ||
methods: { | ||
next() : void { | ||
this.$router.push(`/round/${this.round}/turn/1/${this.startPlayer}`) | ||
}, | ||
determineGoalChip() : void { | ||
this.goalChip = rollDice(6) | ||
} | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.