<template>
  <nav v-if="isGamemaster" class="gamecontrols">
    <button @click="startGame">Start</button>
  </nav>
</template>

<script>
export default {
  computed: {
    user() {
      return this.$store.state.engine.user || {}
    },
    isGamemaster() {
      const user = this.$store.state.engine.user
      return user && user.role === 'gamemaster'
    },
  },
  methods: {
    startGame() {
      this.$engine.startGame()
    },
  },
}
</script>

<style lang="scss">
.gamecontrols {
  padding: 8px 1em;
  border-bottom: 1px solid #808080;
}
</style>
