package ats_jp.activity.profile; import java.awt.List; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import ats_jp.activity.datastore.ArrayStore; public class PlayerList { private ArrayStore myPlayer; public PlayerList(int size) { myPlayer=new ArrayStore(size); } public boolean addPlayer(PlayerProfile playerProfile) { boolean flag=false; if(playerProfile!=null) { if(!myPlayer.contains(playerProfile)) { flag=myPlayer.add(playerProfile); } } else { throw new IllegalArgumentException("Null argument"); } return flag; } public PlayerProfile findPlayer(int index) { return (PlayerProfile) myPlayer.check(index); } public PlayerProfile findPlayer(PlayerProfile playerProfile) { return (PlayerProfile) myPlayer.check(myPlayer.find(playerProfile)); } public int getMaxPlayerCount() { return myPlayer.getSize(); } public int getPlayerCount() { return myPlayer.getCount(); } public PlayerProfile findPlayer(int index) { return myPlayer.check(index); } public PlayerProfile findPlayer(PlayerProfile arg) { return myPlayer.find(arg); } public PlayerProfile[] findPlayer(String nome) { // mi creo un qualcosa di appoggio ArrayList mList=new ArrayList(); for(int i=0; i