package com.ppa8ball;

import java.util.ArrayList;
import java.util.List;

import com.ppa8ball.stats.PlayerStat;
import com.ppa8ball.stats.PlayersStat;
import com.ppa8ball.stats.TeamStat;

public class TeamRoster {

	public Player[] players = new Player[5];
	public String name;
	public int number;
	
	public TeamRoster()
	{
	}
	
	public TeamRoster(TeamStat teamStat)
	{
		this(teamStat, new ArrayList<PlayerStat>());
	}
	
	public TeamRoster(TeamStat teamStat, PlayersStat playersStat)
	{
		this(teamStat, playersStat.players);
	}
	
	public TeamRoster(TeamStat teamStat, List<PlayerStat> playerStats)
	{
		this.name = teamStat.name;
		this.number = teamStat.number;
		
		int i=0;
		for (PlayerStat playerStat : playerStats) {
			players[i++] = new Player(playerStat);
		}
	}
	
	public TeamRoster(TeamStat teamStat, Player [] players)
	{
		this.name = teamStat.name;
		this.number = teamStat.number;
		this.players = players;
	}
}

@@ -892,16 +892,100 @@
 number;%0A
+%09%09%0A%09%09for (int i=players.length;i %3C5;i++)%0A%09%09%7B%0A%09%09%09players%5Bi-1%5D = new Player();%0A%09%09%7D%0A%09%09%0A
 %09%09this.p

add players to roster if there are less than 5