Manage game state through object injection everywhere, fixed filling buffer and stopping clock in Game.

This commit is contained in:
2020-12-21 17:27:16 +01:00
parent a66f6e1fa4
commit eebca998cb
9 changed files with 70 additions and 75 deletions

View File

@@ -10,11 +10,13 @@
</template>
<script lang="ts">
import {defineComponent, inject} from "vue";
import { Game } from "@/game/Game";
import {computed, defineComponent, inject, Ref} from "vue";
export default defineComponent({
setup() {
const sequences = inject("sequences");
const game = inject("game") as Ref<Game>;
const sequences = computed(() => game.value.sequences);
return {
sequences