diff options
Diffstat (limited to 'WebInterface/NodeJSServer/src/js/modules/networking/commands/loginCmds.js')
-rw-r--r-- | WebInterface/NodeJSServer/src/js/modules/networking/commands/loginCmds.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/WebInterface/NodeJSServer/src/js/modules/networking/commands/loginCmds.js b/WebInterface/NodeJSServer/src/js/modules/networking/commands/loginCmds.js new file mode 100644 index 0000000..bc5d8a7 --- /dev/null +++ b/WebInterface/NodeJSServer/src/js/modules/networking/commands/loginCmds.js @@ -0,0 +1,36 @@ +import ListServers from './login/listServers'; +import CreateServer from './login/createServer'; +import Login from './login/login'; + +/** + * Manages commands related to the login page + */ +export default class LoginCommands { + /** + * Initializes the login commands + * @param {Interface} iface Interface for inter-object communication + */ + constructor(iface) { + this.iface = iface; + this.cmds = []; + this.registerCommands(); + } + + /** + * Registers all the available commands + */ + registerCommands() { + this.cmds.push(new ListServers(this.iface)); + this.cmds.push(new CreateServer(this.iface)); + this.cmds.push(new Login(this.iface)); + } + + /** + * Destroys all attached commands + */ + destroy() { + for (let cmd of this.cmds) { + cmd.destroy(); + } + } +} |