currencies as object; lintfix
This commit is contained in:
parent
cd8cdd31e3
commit
cf54e26dbf
|
@ -1,15 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
<button @click="add"> add {{addIncrement}} </button>
|
||||
<button @click="stepup"> {{mulIncrement}}x addition per step </button>
|
||||
<button @click="jumpup"> 10x more multiplication per step</button>
|
||||
<button @click="add">add {{ addIncrement }}</button>
|
||||
<button @click="stepup">{{ mulIncrement }}x addition per step</button>
|
||||
<button @click="jumpup">10x more multiplication per step</button>
|
||||
<button @click="toggletimer">Tick automatically</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Decimal from "break_infinity.js";
|
||||
import Decimal from 'break_infinity.js'
|
||||
|
||||
export default {
|
||||
name: 'InfinityTester',
|
||||
|
@ -18,42 +17,44 @@ export default {
|
|||
addIncrement: new Decimal(100),
|
||||
mulIncrement: new Decimal(10),
|
||||
bigValue: new Decimal(0),
|
||||
timerRunning: false
|
||||
timerRunning: false,
|
||||
}
|
||||
},
|
||||
beforeMount () {
|
||||
beforeMount() {
|
||||
window.setInterval(() => {
|
||||
this.gametick();
|
||||
},250);
|
||||
this.gametick()
|
||||
}, 250)
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
add() {
|
||||
// this.bigValue = Decimal.add(this.bigValue, this.addIncrement);
|
||||
this.$store.commit("incremental/add",
|
||||
{key: "energy", value: this.addIncrement}
|
||||
)
|
||||
this.$store.commit('incremental/add', {
|
||||
key: 'energy',
|
||||
value: this.addIncrement,
|
||||
})
|
||||
},
|
||||
|
||||
stepup () {
|
||||
this.addIncrement = Decimal.mul(this.addIncrement, this.mulIncrement);
|
||||
stepup() {
|
||||
this.addIncrement = Decimal.mul(this.addIncrement, this.mulIncrement)
|
||||
},
|
||||
|
||||
jumpup() {
|
||||
this.mulIncrement = Decimal.mul(this.mulIncrement, 10.0);
|
||||
this.mulIncrement = Decimal.mul(this.mulIncrement, 10.0)
|
||||
},
|
||||
|
||||
gametick() {
|
||||
if (this.timerRunning) {
|
||||
this.$store.commit("incremental/add",
|
||||
{key: "energy", value: this.addIncrement}
|
||||
)
|
||||
this.$store.commit('incremental/add', {
|
||||
key: 'energy',
|
||||
value: this.addIncrement,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
toggletimer() {
|
||||
this.timerRunning = !(this.timerRunning)
|
||||
}
|
||||
}
|
||||
this.timerRunning = !this.timerRunning
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -38,14 +38,14 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Decimal from "break_infinity.js"
|
||||
import Decimal from 'break_infinity.js'
|
||||
|
||||
export default {
|
||||
name: 'TabNav',
|
||||
data() {
|
||||
return {
|
||||
energycurrency: new Decimal(0),
|
||||
timecurrency: new Decimal(0)
|
||||
timecurrency: new Decimal(0),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -67,7 +67,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
increaseCurrency (energy, time) {
|
||||
increaseCurrency(energy, time) {
|
||||
this.energycurrency = Decimal.add(this.energycurrency, energy)
|
||||
this.timecurrency = Decimal.add(this.timecurrency, time)
|
||||
},
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
export default {
|
||||
currencies: [
|
||||
"energy",
|
||||
"seasons",
|
||||
"months",
|
||||
"days",
|
||||
"hours",
|
||||
"seconds",
|
||||
"nanoseconds",
|
||||
"plancktime"
|
||||
]
|
||||
|
||||
currencies: {
|
||||
energy: 'energy',
|
||||
seasons: 'seasons',
|
||||
months: 'months',
|
||||
days: 'days',
|
||||
hours: 'hours',
|
||||
seconds: 'seconds',
|
||||
nanoseconds: 'nanoseconds',
|
||||
plancktime: 'plancktime',
|
||||
},
|
||||
}
|
||||
|
|
Reference in New Issue