@Override
	public void update(Observable ml, Object e) {
		Warborn model = (Warborn)ml;
		
		currentPlayer.setText(model.getCurrentPlayer().getFullName());
		currentState.setText("Battle Phase");
		float[] hsbFloats = {0,0,0};
		Color.RGBtoHSB(model.getCurrentPlayer().getColor().brighter().getRed(),
				model.getCurrentPlayer().getColor().brighter().getGreen(),
				model.getCurrentPlayer().getColor().brighter().getBlue(), hsbFloats);
		this.setBackground(Color.getHSBColor(hsbFloats[0],hsbFloats[1]/3,hsbFloats[2]+((1-hsbFloats[2])/2)));
		phaseInfo.setBackground(Color.getHSBColor(hsbFloats[0],hsbFloats[1]/4,hsbFloats[2]+((1-hsbFloats[2])/2)));
		reinforcements.setVisible(false);
		for (int i=0; i<soulPanelbtns.length; i++){
			soulPanelbtns[i].setIcon(null);
			if (model.getCurrentPlayer().getCards()[i]!=null){
				soulPanelbtns[i].setIcon(model.getCurrentPlayer().getCard(i).getImage());
				soulPanelbtns[i].setToolTipText(model.getCurrentPlayer().getCard(i).getName());
			}
		}
		playersPanel.revalidate();
		
		if (model.getCurrentPlayer().canExchangeSouls()){
			useSouls.setEnabled(true);
		}else{
			useSouls.setEnabled(false);
		}
		
		if (model.getState() == 3){
			next.setText("End Turn");
			currentState.setText("Troop Movement");
		}else{
			next.setText("Next Phase");
		}
		
		if (model.getState()==1){
			
			reinforcements.setText("Reinforcements: " + model.getNbrOfReinforcements());
			reinforcements.setVisible(true);
			currentState.setText("Reinforce your Troops");
		}
		
		if (model.getNbrOfReinforcements() != 0){
			next.setEnabled(false);
		}else{
			next.setEnabled(true);
		}
		
		for (int i = 0; i < model.getNumberOfPlayers(); i++){
			if(!model.getPlayer(i).isDefeated()){
				playerNameArray[i].setText(model.getPlayer(i).getFullName());
			}else{
				playerNameArray[i].setText(model.getPlayer(i).getFullName() + " is Defeated");
			}
			playerNameArray[i].setForeground(model.getPlayer(i).getColor());
			territoriesArray[i].setText("Number of Territories:  " + model.getPlayer(i).getNbrOfTerritories());
			troopsArray[i].setText("Number of Troups:  " + calculateNbrOfUnits(i));
			manaArray[i].setText("Mana:  " + model.getPlayer(i).getMana());
		}
		if(model.getState() == 0){
			currentState.setText("Reinforce");
			next.setEnabled(false);
			spellbookButton.setEnabled(false);
		}else{
			spellbookButton.setEnabled(true);
		}
	}