summaryrefslogtreecommitdiff
path: root/webcards/scripts/client/lobby.js
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-04-03 16:44:23 -0400
committerKyle Gunger <corechg@gmail.com>2020-04-03 16:44:23 -0400
commit1697da112a9b9f529fad2f54c62aecd7bbb614e6 (patch)
tree68c7cd383107e824953b6aa213d05d9a6842b73f /webcards/scripts/client/lobby.js
parent3040a822085adeb9025ddc1a4573cf37cb37d377 (diff)
[WEBCARDS] Update some webcards stuff
Diffstat (limited to 'webcards/scripts/client/lobby.js')
-rw-r--r--webcards/scripts/client/lobby.js102
1 files changed, 0 insertions, 102 deletions
diff --git a/webcards/scripts/client/lobby.js b/webcards/scripts/client/lobby.js
deleted file mode 100644
index 8d46352..0000000
--- a/webcards/scripts/client/lobby.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// Lobby manages the players and games provided by the server and allows users to join or create their own games.
-function Lobby(el){
- this.root = el;
-
- this.elements = {
- status: this.root.getElementsByClassName("status")[0],
- addr: this.root.getElementsByClassName("addr")[0],
-
- stats: {
- game: document.getElementById("game"),
- packs: document.getElementById("packs"),
- online: document.getElementById("online"),
- ingame: document.getElementById("ingame"),
- pubgame: document.getElementById("pubgame")
- },
-
- settings: {
- name: document.getElementById("name"),
- color: document.getElementById("usercolor")
- }
- };
-
- this.top = new TopBar(document.getElementsByClassName("topbar")[0]);
-
- this.init = false;
- this.online = [];
- this.games = [];
- this.packs = [];
- this.players = [];
-}
-
-Lobby.prototype = {
- packList: function(data){
-
- this.elements.stats.packs.innerText = this.packs.length();
- },
-
- gameList: function(data, game){
-
- this.elements.stats.pubgame.innerText = this.games.length();
- },
-
- players: function(data) {
-
- this.elements.stats.online.innerText = this.players.length();
- this.init = true;
- },
-
- addGame: function(data){
-
- },
-
- removeGame: function(data){
-
- },
-
- addPlayer: function(data){
-
- },
-
- movePlayer: function(data){
-
- },
-
- removePlayer: function(data){
-
- },
-
- newGameScreen: function(){
- if(this.init) return;
- },
-
- setState: function(text, color, server){
- this.elements.status.style.backgroundColor = color;
- this.elements.status.innerText = text;
- this.elements.addr.innerText = server;
- this.top.setColor(color);
- },
-
- reset: function(){
- this.setState("Connecting", "#DA0", this.elements.addr.innerText);
- this.init = false;
- }
-};
-
-// ###############
-// # TopBar Code #
-// ###############
-
-function TopBar(el) {
- this.root = el;
-
- this.newGame = el.getElementsByClassName("new-game")[0];
- this.mobileSettings = el.getElementsByClassName("mobile-settings")[0];
- this.status = el.getElementsByClassName("status")[0];
-}
-
-TopBar.prototype = {
- setColor: function(color) {
- this.status.style.backgroundColor = color;
- }
-};