@Override
    public void update(Observable o, Object arg) {
        
        EventEnum newEvent = (EventEnum) arg;
        if (newEvent == EventEnum.CONNECTIONOK) {
            this.showMainPanel();
            System.out.println(CONNECTIONESTABLISHEDMESSAGE);
        }
        
        
        else if (newEvent == EventEnum.CONNECTIONREFUSED) {
            this.showConnectionPanel();
            JOptionPane.showMessageDialog(this, CONNECTIONNOTESTABLISHEDMESSAGE);
            System.out.println(CONNECTIONNOTESTABLISHEDMESSAGE);
        }
        
        else if (newEvent == EventEnum.GAMERESPONSE) {
            this.panel.updateView(newEvent);
            this.pack();
        }
        
        else  if (newEvent == EventEnum.GAMEOVER) {
            this.panel.updateView(newEvent); 
            this.disablePanel();
            JOptionPane.showMessageDialog(this, LOSEMESSAGE);
            System.out.println(LOSEMESSAGE);
            
        }
        else  if (newEvent == EventEnum.CONGRATULATIONS) {
            this.panel.updateView(newEvent);
            this.disablePanel();
            JOptionPane.showMessageDialog(this, WINMESSAGE);
            System.out.println(WINMESSAGE);
            
        }
        else if (newEvent == EventEnum.SERVERDOWN) {
            this.serverDown();
        }
        
    }