package tp.pr5.logic;

import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

public class PlayersModel implements ComboBoxModel<PlayerType> {
	
	private Counter player;
	private PlayerType selected;
	
	public PlayersModel(Counter player){
		this.player = player;
		this.selected = player.getMode();
	}

	public int getSize() {
		return 2;
	}

	@Override
	public PlayerType getElementAt(int index) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void addListDataListener(ListDataListener l) {
		// TODO Auto-generated method stub

	}

	public void setSelectedItem(Object anItem) {
		this.selected = (PlayerType) anItem;
		//ctrl.setPlayerMode(player, this.selected);
		
		//that upper line is supposed to belike that and call the controller but i cannot see how by now.
	}

	@Override
	public Object getSelectedItem() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public void removeListDataListener(ListDataListener l) {
		// TODO Auto-generated method stub

	}
	
	public String toString(){
		return null;//TODO: this function
	}

}

@@ -94,16 +94,57 @@
 tener;%0A%0A
+import tp.pr5.control.WindowController;%0A%0A
 public c
@@ -257,16 +257,48 @@
 lected;%0A
+%09private WindowController ctrl;%0A
 %09%0A%09publi
@@ -326,16 +326,40 @@
 r player
+, WindowController wCont
 )%7B%0A%09%09thi
@@ -413,16 +413,37 @@
 Mode();%0A
+%09%09this.ctrl = wCont;%0A
 %09%7D%0A%0A%09pub
@@ -540,72 +540,89 @@
 %7B%0A%09%09
-// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%0A%09@Override
+if (index == 0)%0A%09%09%09return PlayerType.HUMAN;%0A%09%09else%0A%09%09%09return PlayerType.AUTO;%0A%09%7D%0A
 %0A%09pu
@@ -802,18 +802,16 @@
 Item;%0A%09%09
-//
 ctrl.set
@@ -850,227 +850,74 @@
 );%0A%09
-%09%0A%09%09//that upper line is supposed to belike that and call the controller but i cannot see how by now.%0A%09%7D%0A%0A%09@Override%0A%09public Object getSelectedItem() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%09%0A%09@Override
+%7D%0A%0A%09public Object getSelectedItem() %7B%0A%09%09return this.selected;%0A%09%7D%0A%09
 %0A%09pu
@@ -1015,76 +1015,8 @@
 %0A%0A%09%7D
-%0A%09%0A%09public String toString()%7B%0A%09%09return null;//TODO: this function%0A%09%7D
 %0A%0A%7D%0A

Update PlayersModel.java