using System;

namespace VRepProxy.Objects
{
	public class ProximitySensor:Sensor
	{
		public ProximitySensor(){
			Category = CATEGORY_SENSOR;
		}

		public double[] Get(){
			double[] dvalues = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
			String sensors = VRepProxy.Proxy.VRepProxy.Get ("get psensor");
			if (sensors != null) {
				String[] svalues = sensors.Split (new string[]{ ", " }, StringSplitOptions.None);
				dvalues = new double[svalues.Length];
				double n;
				for (int i = 0; i < svalues.Length; i++) {
					if (Double.TryParse (svalues [i], out n)) {
						dvalues [i] = n;
					}
				}
			}
			return dvalues;
		}
	}
}

