diff --git a/lootalot_front/src/App.vue b/lootalot_front/src/App.vue index 0f7f5d9..c1b47d7 100644 --- a/lootalot_front/src/App.vue +++ b/lootalot_front/src/App.vue @@ -18,13 +18,15 @@ export const store = { debug: true, state: { player_id: 0, + player_list: [ + {id: 0, name: "Groupe", wealth: [0,0,0,0], debt: 0}, + {id: 1, name: "Lomion", wealth: [0,0,0,0], debt: 0}, + {id: 4, name: "Oilosse", wealth: [0,0,0,0], debt: 0}, + {id: 3, name: "Fefi", wealth: [0,0,0,0], debt: 0}, + ], show_player_chest: false, - // methods - isPlayer () { - this.player_id != 0 - }, - isGroup () { - this.player_id == 0 + requests: { // TEST: must be initialised with players ids + 0: [], 1: [], 4: [], 3: [] }, }, setActivePlayer (newPlayerId) { @@ -36,7 +38,12 @@ export const store = { switchPlayerChestVisibility () { if (this.debug) console.log('switchPlayerChestVisibility', !this.state.show_player_chest) this.state.show_player_chest = !this.state.show_player_chest - } + }, + putRequest (itemId) { + const playerId = this.state.player_id + if (this.debug) console.log('newRequest from', playerId, 'on', itemId) + this.state.requests[playerId].push(itemId); + }, } function getCookie(cname) { diff --git a/lootalot_front/src/components/Chest.vue b/lootalot_front/src/components/Chest.vue index 0c0fa1c..d572d30 100644 --- a/lootalot_front/src/components/Chest.vue +++ b/lootalot_front/src/components/Chest.vue @@ -5,7 +5,7 @@ Objets de {{ player }} - +