Feat : end turn
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { containerEvents } from '~/netcode/events';
|
import { containerEvents } from '~/netcode/events';
|
||||||
import type { Container } from '~/netcode/interfaces';
|
import type { Container } from '~/netcode/interfaces';
|
||||||
import type { CardParser } from '~/netcode/interfaces/cards';
|
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
container: Container
|
container: Container
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import goStore, { buy, useEffect } from '@/netcode';
|
import type { Container } from '~/netcode/interfaces';
|
||||||
import { CardEffects, type Effect } from '@/netcode/Effect'
|
|
||||||
import { CardType } from '@/netcode/Card'
|
|
||||||
import gsap from 'gsap'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 isTurn = computed(() => goStore.self && goStore.current_game?.started && (goStore.self.team == goStore.current_game.current_turn))
|
||||||
const clientStore = useClientSideStore()
|
const clientStore = useClientSideStore()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { endTurn } from "~/netcode";
|
import { endTurn } from "~/netcode";
|
||||||
import type { Game, Player } from "~/netcode/interfaces";
|
import type { Game, Player } from '~/netcode/interfaces';
|
||||||
import { CardEffects, type CardParser } from "~/netcode/interfaces/cards";
|
|
||||||
import { useClientSideStore } from "~/stores/turn";
|
import { useClientSideStore } from "~/stores/turn";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
|||||||
@@ -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
@@ -4,12 +4,10 @@ export default defineNuxtConfig({
|
|||||||
ssr: false,
|
ssr: false,
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
endpoint: 'http://localhost:8765', // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
|
endpoint: "http://localhost:8765", // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
|
||||||
discordLoginEndpoint: ''
|
discordLoginEndpoint:
|
||||||
}
|
"https://discord.com/oauth2/authorize?client_id=460020057867681792&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Flogin&scope=identify",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
modules: [
|
modules: ["@pinia/nuxt", "@pinia-plugin-persistedstate/nuxt"],
|
||||||
'@pinia/nuxt',
|
});
|
||||||
'@pinia-plugin-persistedstate/nuxt',
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|||||||
+2
-2
@@ -131,7 +131,7 @@ onUnmounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div @contextmenu.prevent="false" id="game_board">
|
<div @contextmenu.prevent="false" id="game_board" v-if="game">
|
||||||
<AnimatedBackground @ready="loaded = true"></AnimatedBackground>
|
<AnimatedBackground @ready="loaded = true"></AnimatedBackground>
|
||||||
<div id="stack_discard">
|
<div id="stack_discard">
|
||||||
<div id="stack">
|
<div id="stack">
|
||||||
@@ -145,7 +145,7 @@ onUnmounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <MarketCards></MarketCards> -->
|
<!-- <MarketCards :container="game.market"></MarketCards> -->
|
||||||
|
|
||||||
<div id="player_list_container">
|
<div id="player_list_container">
|
||||||
<div id="player_list">
|
<div id="player_list">
|
||||||
|
|||||||
Reference in New Issue
Block a user