Hand player update

This commit is contained in:
2024-04-20 00:36:27 +02:00
parent 638895f0bc
commit 571bcd14d3
5 changed files with 37 additions and 9 deletions
+12 -2
View File
@@ -1,17 +1,27 @@
<script setup lang="ts">
const props = defineProps(['data'])
const props = defineProps({
data: {
type: String as PropType<string>,
required: false,
},
})
const cards = useState<{ [key: string]: any }>('cards')
function cardClick() {
if (!props.data) return
console.log(JSON.parse(JSON.stringify(cards.value[props.data].effects)))
}
</script>
<template>
<span @click="cardClick">
<span v-if="props.data" @click="cardClick">
{{ cards[props.data].name }}
</span>
<span v-if="!props.data">
HIDDEN
</span>
|
</template>
+1 -1
View File
@@ -4,6 +4,6 @@ const props = defineProps(['stack'])
<template>
<span>
<CardPreview v-for="c in props.stack" :data="c" :key="c.uuid" />
<CardPreview v-for="c in props.stack" :data="c" />
</span>
</template>
+3 -1
View File
@@ -7,7 +7,7 @@ const gameObject = useState<{ [key: string]: any }>('gameObject')
<template>
<div>
<div>
self = {{ self?.username }}
self = {{ gameObject[self]?.username }}
<br>
market_amount = {{ props.game.market_stack?.length }}
<br>
@@ -18,6 +18,8 @@ const gameObject = useState<{ [key: string]: any }>('gameObject')
<CardSlot :stack="props.game.gem_stack" />
</div>
<div>
<PlayerSlot :player="self"></PlayerSlot>
<br>
players = {{ props.game.players?.map((e: any) => gameObject[e].username) }}
</div>
</div>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
const props = defineProps(['player'])
const gameObject = useState<{ [key: string]: any }>('gameObject')
</script>
<template>
<span>
hand =
<CardSlot :stack="gameObject[props.player]?.hand" />
<br>
stack =
<CardSlot :stack="gameObject[props.player]?.stack_pile" />
<br>
discard =
<CardSlot :stack="gameObject[props.player]?.discard_pile" />
</span>
</template>