feat: first tab draft 2; adjust tick and worker mechanics

This commit is contained in:
pskfyi 2022-01-10 02:16:25 -08:00 committed by pskfyi
commit ea1a65766d
4 changed files with 187 additions and 102 deletions

View file

@ -1,36 +1,40 @@
<template>
<div class="tab-content grid flex-col">
<template v-for="(process, index) in $store.state.processes">
<button :key="process.instrument" class="text-right font-semibold">
{{ process.instrument }}
</button>
<div :key="index" class="progress-bar relative">
<progress
max="100"
:value="process.completion"
class="w-full h-full"
></progress>
<span
class="absolute top-0 bottom-0 left-0 right-0 text-center text-white"
>
{{
(process.workerCount * process.workerRate * process.reward) / 100.0
}}
<span class="fas fa-hourglass-half text-sm" /> / sec
<!-- {{ $store.state.incremental.currency[process.produces] }} {{ process.produces }} -->
</span>
</div>
</template>
<div>
<responsive-grid class="mb-4">
<progress-button
v-for="(process, index) in uncreated"
:key="index"
:label="process.instrument"
:max="process.cost"
:value="$store.state.currency"
@click="create(process.instrument)"
/>
</responsive-grid>
<responsive-grid min="2" mid="4" max="8">
<timekeeping-instrument
v-for="(process, index) in created"
:key="index"
:process="process"
/>
</responsive-grid>
</div>
</template>
<script>
export default {}
</script>
<style scoped>
.tab-content {
grid-template-columns: auto 1fr;
grid-gap: 1rem 1rem;
export default {
computed: {
created() {
return this.$store.state.processes.filter((p) => p.created)
},
uncreated() {
return this.$store.state.processes.filter((p) => !p.created)
},
},
methods: {
create(instrument) {
this.$store.commit('createInstrument', instrument)
},
},
}
</style>
</script>