private int recruitPay(Player player, UnitType unit)
	{
		float gold = player.getResource(core.ResourceType.GOLD)/(float)unit.cost.gold;
		float wood = player.getResource(core.ResourceType.WOOD)/(float)unit.cost.wood;
		float ore = player.getResource(core.ResourceType.ORE)/(float)unit.cost.ore;
		float min = getAvailableToRecruit(unit.level);
		if (gold < min) min = gold;
		if (wood < min) min = wood;
		if (ore < min) min = ore;
		int max = (int)min;
		
		player.addResource(core.ResourceType.GOLD, -max*unit.cost.gold);
		player.addResource(core.ResourceType.WOOD, -max*unit.cost.wood);
		player.addResource(core.ResourceType.ORE, -max*unit.cost.ore);
		
		addAvailableToRecruit(unit.level, -max);
		return max;
	}