Feat : end turn

This commit is contained in:
2024-06-27 19:40:29 +02:00
parent 0a8313b69d
commit 6cc91d58ce
6 changed files with 55 additions and 17 deletions
-1
View File
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { containerEvents } from '~/netcode/events';
import type { Container } from '~/netcode/interfaces';
import type { CardParser } from '~/netcode/interfaces/cards';
export interface Props {
container: Container
+11 -4
View File
@@ -1,11 +1,18 @@
<script setup lang="ts">
import goStore, { buy, useEffect } from '@/netcode';
import { CardEffects, type Effect } from '@/netcode/Effect'
import { CardType } from '@/netcode/Card'
import gsap from 'gsap'
import type { Container } from '~/netcode/interfaces';
export interface Props {
container: Container
}
const props = defineProps<Props>()
const authStore = useAuthStore()
const selfPlayer = computed(() => authStore.logged ? playerList.value?.find(p => p.user.userId == authStore.selfUser.userId) : undefined)
const isTurn = computed(() => goStore.self && goStore.current_game?.started && (goStore.self.team == goStore.current_game.current_turn))
const clientStore = useClientSideStore()
+1 -2
View File
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { endTurn } from "~/netcode";
import type { Game, Player } from "~/netcode/interfaces";
import { CardEffects, type CardParser } from "~/netcode/interfaces/cards";
import type { Game, Player } from '~/netcode/interfaces';
import { useClientSideStore } from "~/stores/turn";
export interface Props {
+35
View File
@@ -0,0 +1,35 @@
export interface GameObject {
_id: string;
}
export interface Game extends GameObject {
fireGems: Container;
market: Container;
marketStack: Container;
teams: Team[];
currentTurn: string;
}
export interface Team extends GameObject {
players: Player[];
}
export interface Player extends GameObject {
board: Container;
discard: Container;
hand: Container;
stack: Container;
user: User;
}
export interface User extends GameObject {
userId: string;
}
export interface Container extends GameObject {
cards: Card[];
}
export interface Card extends GameObject {
cardId: number;
}
+6 -8
View File
@@ -4,12 +4,10 @@ export default defineNuxtConfig({
ssr: false,
runtimeConfig: {
public: {
endpoint: 'http://localhost:8765', // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
discordLoginEndpoint: ''
}
endpoint: "http://localhost:8765", // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
discordLoginEndpoint:
"https://discord.com/oauth2/authorize?client_id=460020057867681792&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Flogin&scope=identify",
},
},
modules: [
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt',
],
})
modules: ["@pinia/nuxt", "@pinia-plugin-persistedstate/nuxt"],
});
+2 -2
View File
@@ -131,7 +131,7 @@ onUnmounted(() => {
</script>
<template>
<div @contextmenu.prevent="false" id="game_board">
<div @contextmenu.prevent="false" id="game_board" v-if="game">
<AnimatedBackground @ready="loaded = true"></AnimatedBackground>
<div id="stack_discard">
<div id="stack">
@@ -145,7 +145,7 @@ onUnmounted(() => {
</div>
</div>
<!-- <MarketCards></MarketCards> -->
<!-- <MarketCards :container="game.market"></MarketCards> -->
<div id="player_list_container">
<div id="player_list">