fix: init board
This commit is contained in:
@@ -3,7 +3,6 @@ import { Chart as ChartJS, registerables } from 'chart.js'
|
||||
import { useBoardGameStore } from '@/modules/5s/board-game-store'
|
||||
import { toDuration, toSeconds } from '@/modules/5s/utils'
|
||||
import { getNatural } from '@/utils'
|
||||
import { _ } from '@faker-js/faker/dist/airline-D6ksJFwG'
|
||||
import { computed, ref } from 'vue'
|
||||
import { Bar } from 'vue-chartjs'
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ defineProps<{ alias: string }>()
|
||||
|
||||
const featureStore = useFeatureStore()
|
||||
|
||||
onMounted(() => featureStore.initBoard('mobile-app', NUMBER_OF_FEATURES))
|
||||
onMounted(() => featureStore.initBoard(NUMBER_OF_FEATURES))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -13,7 +13,7 @@ const featureStore = useFeatureStore()
|
||||
|
||||
const confirmReset = () => {
|
||||
if (confirm('Are you sure you want to reset the board?')) {
|
||||
featureStore.initBoard('mobile-app', NUMBER_OF_FEATURES)
|
||||
featureStore.initBoard(NUMBER_OF_FEATURES)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -72,6 +72,7 @@ const mayBeInProgress = ({
|
||||
|
||||
export const newBacklog = (limit?: number) => {
|
||||
const initialFeatures = [...mobileAppFeatures]
|
||||
|
||||
return limit !== undefined
|
||||
? popNElement(shuffleArray(initialFeatures), limit)
|
||||
: shuffleArray(initialFeatures)
|
||||
@@ -249,8 +250,8 @@ export const nextDay = (
|
||||
strategy: Strategy | 'problem-solving'
|
||||
): FeatureState => {
|
||||
state.meta.totalDays++
|
||||
// // each day, the teams know how to better work together
|
||||
// state.meta.teamWorkExperience += 0.1
|
||||
// each day, the teams know how to better work together
|
||||
// state.meta.teamWorkExperience += 0.1 // Removed with a simplified version of pull system without the problem-solving strategy
|
||||
|
||||
if (strategy === 'problem-solving') {
|
||||
const hasTeamLearned = randomFloat(0, 1) > 0.25
|
||||
@@ -301,7 +302,7 @@ export const simulate = (
|
||||
): FeatureState => {
|
||||
let i = 0
|
||||
|
||||
while (!isProjectFinished(state.features) && i++ < HARD_STOP) {
|
||||
while (i++ < HARD_STOP && !isProjectFinished(state.features)) {
|
||||
if (strategy.includes('dps')) {
|
||||
if (state.meta.totalDays % 5 === 0) {
|
||||
state = nextDay(state, 'problem-solving')
|
||||
|
||||
@@ -37,6 +37,7 @@ export const useFeatureStore = defineStore('feature', {
|
||||
async initBoard(limit?: number) {
|
||||
this.backlog = newBacklog(limit)
|
||||
this.steps = featureSteps
|
||||
|
||||
const initialSteps = featureSteps.filter(
|
||||
(step) => step.title !== 'Release' && step.title !== 'Development'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user