}
public void renamePlayer(String oldname,String newName,int newtype) {
for(int index = 0;index<playersModel.size();index++) {
Player player = (Player)playersModel.get(index);
if(oldname.equals(player.getName())) {
player.renamePlayer(newName,newtype);
break;
}
}
if (oldname.equals(currentPlayer)) {
currentPlayer = newName;