currencies as object; lintfix

This commit is contained in:
John McCardle 2022-01-06 18:35:43 -05:00
parent cd8cdd31e3
commit cf54e26dbf
3 changed files with 50 additions and 50 deletions

View File

@ -1,15 +1,14 @@
<template> <template>
<div> <div>
<button @click="add"> add {{addIncrement}} </button> <button @click="add">add {{ addIncrement }}</button>
<button @click="stepup"> {{mulIncrement}}x addition per step </button> <button @click="stepup">{{ mulIncrement }}x addition per step</button>
<button @click="jumpup"> 10x more multiplication per step</button> <button @click="jumpup">10x more multiplication per step</button>
<button @click="toggletimer">Tick automatically</button> <button @click="toggletimer">Tick automatically</button>
</div> </div>
</template> </template>
<script> <script>
import Decimal from 'break_infinity.js'
import Decimal from "break_infinity.js";
export default { export default {
name: 'InfinityTester', name: 'InfinityTester',
@ -18,42 +17,44 @@ export default {
addIncrement: new Decimal(100), addIncrement: new Decimal(100),
mulIncrement: new Decimal(10), mulIncrement: new Decimal(10),
bigValue: new Decimal(0), bigValue: new Decimal(0),
timerRunning: false timerRunning: false,
} }
}, },
beforeMount () { beforeMount() {
window.setInterval(() => { window.setInterval(() => {
this.gametick(); this.gametick()
},250); }, 250)
}, },
methods: { methods: {
add () { add() {
// this.bigValue = Decimal.add(this.bigValue, this.addIncrement); // this.bigValue = Decimal.add(this.bigValue, this.addIncrement);
this.$store.commit("incremental/add", this.$store.commit('incremental/add', {
{key: "energy", value: this.addIncrement} key: 'energy',
) value: this.addIncrement,
}, })
},
stepup () { stepup() {
this.addIncrement = Decimal.mul(this.addIncrement, this.mulIncrement); this.addIncrement = Decimal.mul(this.addIncrement, this.mulIncrement)
}, },
jumpup() { jumpup() {
this.mulIncrement = Decimal.mul(this.mulIncrement, 10.0); this.mulIncrement = Decimal.mul(this.mulIncrement, 10.0)
}, },
gametick() { gametick() {
if (this.timerRunning) { if (this.timerRunning) {
this.$store.commit("incremental/add", this.$store.commit('incremental/add', {
{key: "energy", value: this.addIncrement} key: 'energy',
) value: this.addIncrement,
} })
}, }
},
toggletimer() { toggletimer() {
this.timerRunning = !(this.timerRunning) this.timerRunning = !this.timerRunning
} },
} },
} }
</script> </script>

View File

@ -38,14 +38,14 @@
</template> </template>
<script> <script>
import Decimal from "break_infinity.js" import Decimal from 'break_infinity.js'
export default { export default {
name: 'TabNav', name: 'TabNav',
data() { data() {
return { return {
energycurrency: new Decimal(0), energycurrency: new Decimal(0),
timecurrency: new Decimal(0) timecurrency: new Decimal(0),
} }
}, },
methods: { methods: {
@ -67,9 +67,9 @@ export default {
} }
} }
}, },
increaseCurrency (energy, time) { increaseCurrency(energy, time) {
this.energycurrency = Decimal.add(this.energycurrency, energy) this.energycurrency = Decimal.add(this.energycurrency, energy)
this.timecurrency = Decimal.add(this.timecurrency, time) this.timecurrency = Decimal.add(this.timecurrency, time)
}, },
}, },
} }

View File

@ -1,13 +1,12 @@
export default { export default {
currencies: [ currencies: {
"energy", energy: 'energy',
"seasons", seasons: 'seasons',
"months", months: 'months',
"days", days: 'days',
"hours", hours: 'hours',
"seconds", seconds: 'seconds',
"nanoseconds", nanoseconds: 'nanoseconds',
"plancktime" plancktime: 'plancktime',
] },
} }