forked from noxious/client
stash
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* https://pinia.vuejs.org/
|
||||
*/
|
||||
import { defineStore } from 'pinia';
|
||||
import {useMapStore} from '@/stores/map'
|
||||
import {useZoneStore} from '@/stores/zone'
|
||||
import { io, Socket } from 'socket.io-client';
|
||||
import config from '@/config';
|
||||
import axios from 'axios';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const useMapStore = defineStore('gameMap', {
|
||||
export const useZoneStore = defineStore('zone', {
|
||||
state: () => ({
|
||||
loaded: false,
|
||||
tiles: undefined,
|
||||
@ -16,14 +16,14 @@ export const useMapStore = defineStore('gameMap', {
|
||||
this.tiles = tiles;
|
||||
this.loaded = true;
|
||||
},
|
||||
addPlayers(player) {
|
||||
addPlayers(player: any) {
|
||||
this.players = player;
|
||||
},
|
||||
addPlayer(player) {
|
||||
addPlayer(player: any) {
|
||||
this.players[player.id] = player;
|
||||
console.log('Player added:', player);
|
||||
},
|
||||
removePlayer(playerId) {
|
||||
removePlayer(playerId: any) {
|
||||
delete this.players[playerId];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user