From fb6cfd8218d73a83d31bba8b0c242beb63f175d5 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 1 Jan 2021 16:10:30 -0700 Subject: [PATCH] Add players array and related mutations. --- web/src/store/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/src/store/index.js b/web/src/store/index.js index 4b6f8f3..ac692d2 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -46,6 +46,7 @@ export default new Vuex.Store({ chosen_object: null, questions: [], game_code: null, + players: [], }, getters: { teamName(state) { @@ -78,6 +79,20 @@ export default new Vuex.Store({ view(state, target) { state.view = target; }, + playerList(state, players) { + state.players = players; + }, + updatePlayer(state, data) { + for (var player of state.players) { + if (player.name == data.name) { + player.role = data.role; + player.team = data.team; + }; + }; + }, + newPlayer(state, player) { + state.players.push(player); + }, }, actions: { },