import java.lang.reflect.Constructor;


public class PlayerTest
{
	public static void testMyPlayer(Player p)
	{
		boolean ok = true;
		int rounds = 0;
		
		try
		{
			Constructor c = p.getClass().getConstructor(int[].class, int.class);
			
			if (c == null)
			{
				ok = false;
				System.out.println("ERROR: " + p.getClass() + " does not have a public standard constructor matching to 'public " + p.getClass().getCanonicalName() + "(int[] multiset, int target)");
			}
			else
			{
				Player pp = (Player)c.newInstance(new int[]{1}, 1);
			
				if (pp.multiset.length < 1 || pp.multiset[0] != 1 || pp.target != 1)
				{
					ok = false;
					System.out.println("ERROR: " + p.getClass() + " does not call super(multiset, target)");
				}
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
			ok = false;
		}

		if (ok)
			System.out.println(p.getClass().getCanonicalName() + " seems to be ok");
	}
}
