public void initCommands() {
                        cmds = new HashMap<String, Command>();
                        cmds.put(Packet.MESSAGE, new Command() {
                                
                                @Override
                                public void exec(String[] params, String from ) throws InvalidCommandParametersExcetpion {
                                        ui.message(concat(params), from);
                                }
                        });
                        
                        cmds.put(Packet.MOVE, new Command() {
                                @Override
                                public void exec(String[] params, String from) throws InvalidCommandParametersExcetpion {
                                        Point p1 = new Point(Integer.parseInt(params[0]), Integer.parseInt(params[1]));
                                        Point p2 = new Point(Integer.parseInt(params[2]), Integer.parseInt(params[3]));
                                        ui.move(p1, p2, from);
                                        if (color <= 2) {
                                            ui.play(color);
                                        }
                                }
                        });
                        
                        cmds.put(Packet.ERROR, new Command() {
                                @Override
                                public void exec(String[] params, String from) throws InvalidCommandParametersExcetpion {
                                        ui.notifyError(concat(params));
                                }       
                        });
                        
                        cmds.put(Packet.ROOMID, new Command() {
                                
                                @Override
                                public void exec(String[] params, String from)
                                                throws InvalidCommandParametersExcetpion {
                                        color = Integer.parseInt(params[0]) + 1;
                                        
                                }
                        });
                        
                        cmds.put(Packet.START, new Command() {
                                
                                @Override
                                public void exec(String[] params, String from)
                                                throws InvalidCommandParametersExcetpion {
                                        ui.startGame(params[0], params[1]);
                                        if (color == 1) {
                                                ui.play(color);
                                        }     
                                }
                        });
                        
                        cmds.put(Packet.DISCONNECTED, new Command() {
                            
                            @Override
                            public void exec(String[] params, String from)
                                            throws InvalidCommandParametersExcetpion {
                                        	ui.notifyDisconnection(from);
                            }
                    });
                        
                }