22 <SideBar :navigationState =" navigationState " />
33 <h1 >{{t('player.player')}}</h1 >
44
5- <p class =" mt-4" v-html =" t('roundTurnPlayer.execute')" ></p >
5+ <p class =" mt-4" >Select your action:</p >
6+
7+ <div class =" actions" >
8+ <button class =" btn btn-primary btn-lg" @click =" next" >
9+ Make Delivery
10+ </button >
11+ <button class =" btn btn-primary btn-lg" @click =" next" >
12+ Buy Flower
13+ </button >
14+ <button class =" btn btn-primary btn-lg" @click =" next" >
15+ Other Action
16+ </button >
17+ <div >
18+ <button class =" btn btn-outline-danger btn-lg w-100 d-flex align-items-center" data-bs-toggle =" modal" data-bs-target =" #passModal" >
19+ {{t('action.pass')}}<SoloBoardPassActionInfo :soloBoardPassAction =" soloBoardPassAction " />
20+ </button >
21+ <div class =" small mt-1 fst-italic d-flex align-items-center" >
22+ <span >{{t('roundTurnPlayer.passInfo.nextTurn')}}</span ><SoloBoardPassActionInfo :soloBoardPassAction =" soloBoardPassActionNextTurn " :small =" true " />
23+ </div >
24+ </div >
25+ </div >
626
727 <button class =" btn btn-primary btn-lg mt-4" @click =" next" >
828 {{t('action.next')}}
929 </button >
10- <button class =" btn btn-outline-danger btn-lg mt-4 ms-2" data-bs-toggle =" modal" data-bs-target =" #passModal" >
11- {{t('action.pass')}}
12- </button >
1330
1431 <ModalDialog id="passModal" :title =" t (' action.pass' )" >
1532 <template #body >
2744</template >
2845
2946<script lang="ts">
30- import { defineComponent } from ' vue'
47+ import { defineComponent , ref } from ' vue'
3148import { useI18n } from ' vue-i18n'
3249import { useRoute , useRouter } from ' vue-router'
3350import NavigationState from ' @/util/NavigationState'
@@ -36,13 +53,17 @@ import { useStateStore } from '@/store/state'
3653import ModalDialog from ' @brdgm/brdgm-commons/src/components/structure/ModalDialog.vue'
3754import SideBar from ' @/components/round/SideBar.vue'
3855import DebugInfo from ' @/components/round/DebugInfo.vue'
56+ import getSoloBoardPassAction , { SoloBoardPassAction } from ' @/util/getSoloBoardPassAction'
57+ import SoloBoardPassActionInfo from ' @/components/round/SoloBoardPassActionInfo.vue'
58+ import Player from ' @/services/enum/Player'
3959
4060export default defineComponent ({
4161 name: ' RoundTurnPlayer' ,
4262 components: {
4363 FooterButtons ,
4464 ModalDialog ,
4565 SideBar ,
66+ SoloBoardPassActionInfo ,
4667 DebugInfo
4768 },
4869 setup() {
@@ -53,15 +74,24 @@ export default defineComponent({
5374
5475 const navigationState = new NavigationState (route , state )
5576 const { round, turn } = navigationState
77+ const playerDeliveryFloor = ref (navigationState .playerDeliveryFloor )
5678
57- return { t , router , navigationState , state , round , turn }
79+ return { t , router , navigationState , state , round , turn , playerDeliveryFloor }
5880 },
5981 computed: {
6082 backButtonRouteTo() : string {
6183 if (this .turn > 1 ) {
6284 return ` /round/${this .round }/turn/${this .turn - 1 }/player `
6385 }
6486 return ' '
87+ },
88+ soloBoardPassAction() : SoloBoardPassAction {
89+ const { soloBoard, playerTurns, playerDeliveryFloor } = this .navigationState
90+ return getSoloBoardPassAction (soloBoard , playerTurns , playerDeliveryFloor )
91+ },
92+ soloBoardPassActionNextTurn() : SoloBoardPassAction {
93+ const { soloBoard, playerTurns, playerDeliveryFloor } = this .navigationState
94+ return getSoloBoardPassAction (soloBoard , playerTurns + 1 , playerDeliveryFloor )
6595 }
6696 },
6797 methods: {
@@ -72,6 +102,13 @@ export default defineComponent({
72102 this .nextWithPassed (true )
73103 },
74104 nextWithPassed(passed : boolean ) {
105+ this .state .storeRoundTurn ({
106+ round: this .round ,
107+ turn: this .turn ,
108+ player: Player .PLAYER ,
109+ marketPrices: this .navigationState .marketPrices .toPersistence (),
110+ playerDeliveryFloor: this .playerDeliveryFloor
111+ })
75112 if (passed ) {
76113 this .router .push (` /round/${this .round }/turn/${this .turn + 1 }/bot ` )
77114 }
@@ -82,3 +119,12 @@ export default defineComponent({
82119 }
83120})
84121 </script >
122+
123+ <style lang="scss" scoped>
124+ .actions {
125+ display : flex ;
126+ flex-direction : column ;
127+ gap : 1rem ;
128+ max-width : 15rem ;
129+ }
130+ </style >
0 commit comments