-
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.
- Loading branch information
1 parent
2f645e8
commit a5856e0
Showing
7 changed files
with
197 additions
and
0 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,63 @@ | ||
<template> | ||
<h3 class="mt-4 mb-3">{{t('setup.difficultyLevel.title')}}</h3> | ||
|
||
<div class="row"> | ||
<div class="col-3 col-sm-2 col-md-1 text-end"> | ||
<label for="difficultyLevel" class="form-label">{{t('setup.difficultyLevel.easy')}}</label> | ||
</div> | ||
<div class="col-6 col-sm-8 col-md-5"> | ||
<input type="range" class="form-range" min="1" max="6" id="difficultyLevel" | ||
:value="difficultyLevel" @input="updateDifficultyLevel($event)"> | ||
</div> | ||
<div class="col-3 col-sm-2 col-md-1"> | ||
<label for="difficultyLevel" class="form-label">{{t('setup.difficultyLevel.hard')}}</label> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-11 offset-1"> | ||
<i> | ||
{{t('setup.difficultyLevel.level',{level:difficultyLevel})}} | ||
<template v-if="difficultyLevel >= 5"> | ||
({{t('setup.difficultyLevel.expertMode')}}) | ||
</template> | ||
</i> | ||
</div> | ||
</div> | ||
|
||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, ref } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import { useStateStore } from '@/store/state' | ||
import AppIcon from '../structure/AppIcon.vue' | ||
export default defineComponent({ | ||
name: 'DifficultyLevel', | ||
components: { | ||
AppIcon | ||
Check failure on line 38 in src/components/setup/DifficultyLevel.vue GitHub Actions / build
|
||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const state = useStateStore() | ||
const difficultyLevel = ref(state.setup.difficultyLevel) | ||
return { t, state, difficultyLevel } | ||
}, | ||
methods: { | ||
updateDifficultyLevel(event: Event) { | ||
this.difficultyLevel = parseInt((event.target as HTMLInputElement).value) | ||
this.state.setup.difficultyLevel = this.difficultyLevel | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.icon { | ||
height: 1.5rem; | ||
margin-left: 0.25rem; | ||
margin-right: 0.25rem; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<h1>{{t('setupBot.title')}}</h1> | ||
|
||
<div class="instructions"> | ||
<ol> | ||
<li v-html="t('setupBot.soloFarmBoard')"></li> | ||
</ol> | ||
</div> | ||
|
||
<button class="btn btn-primary btn-lg mt-4" @click="startGame()"> | ||
{{t('action.startGame')}} | ||
</button> | ||
|
||
<FooterButtons backButtonRouteTo="/setupGame" endGameButtonType="abortGame"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import { useStateStore } from '@/store/state' | ||
import FooterButtons from '@/components/structure/FooterButtons.vue' | ||
export default defineComponent({ | ||
name: 'SetupBot', | ||
components: { | ||
FooterButtons | ||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const state = useStateStore() | ||
return { t, state } | ||
}, | ||
data() { | ||
return { | ||
showStartingSpace: false | ||
} | ||
}, | ||
methods: { | ||
startGame() : void { | ||
this.$router.push('/round/1/player') | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.instructions { | ||
max-width: 1000px; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<h1>{{t('setup.title')}}</h1> | ||
|
||
<DifficultyLevel/> | ||
|
||
<button class="btn btn-primary btn-lg mt-4" @click="setupBot()"> | ||
{{t('setupBot.title')}} | ||
</button> | ||
|
||
<FooterButtons endGameButtonType="abortGame"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, ref } from 'vue' | ||
Check failure on line 14 in src/views/SetupGame.vue GitHub Actions / build
|
||
import { useI18n } from 'vue-i18n' | ||
import { useStateStore } from '@/store/state' | ||
import FooterButtons from '@/components/structure/FooterButtons.vue' | ||
import DifficultyLevel from '@/components/setup/DifficultyLevel.vue' | ||
import CardDeck from '@/services/CardDeck' | ||
export default defineComponent({ | ||
name: 'SetupGame', | ||
components: { | ||
FooterButtons, | ||
DifficultyLevel | ||
}, | ||
setup() { | ||
const { t } = useI18n() | ||
const state = useStateStore() | ||
return { t, state } | ||
}, | ||
methods: { | ||
setupBot() : void { | ||
this.state.resetGame() | ||
const cardDeck = CardDeck.new() | ||
this.state.setup.initialCardDeck = cardDeck.toPersistence() | ||
this.$router.push('/setupBot') | ||
} | ||
} | ||
}) | ||
</script> |