using System;

namespace VRepProxy.Objects
{
	public class Wheels:VRepObject
	{
		private double vL = 1;

		private double vR = 1
			;
			
		public Wheels(){
			Category = CATEGORY_WHEELS;
		}

		public double[] GetVelocities(){
			double[] velocities = {vL, vR};
			return velocities;
		}

		public Boolean RotateRight()
		{
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + -vR);
		}

		public Boolean RotateRight(double v)
		{
			this.vL = v;
			this.vR = v;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + -vR);
		}

		public Boolean RotateRight(double vL, double vR)
		{
			this.vL = vL;
			this.vR = vR;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + -vR);
		}

		public Boolean RotateLeft()
		{
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + -vL + " " + vR);
		}

		public Boolean RotateLeft(double v)
		{
			this.vL = v;
			this.vR = v;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + -vL + " " + vR);
		}

		public Boolean RotateLeft(double vL, double vR)
		{
			this.vL = vL;
			this.vR = vR;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + -vL + " " + vR);
		}

		public Boolean Move()
		{
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + vR);
		}

		public Boolean Move(double v)
		{
			this.vL = v;
			this.vR = v;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + vR);
		}

		public Boolean Move(double vL, double vR)
		{
			this.vL = vL;
			this.vR = vR;
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move " + vL + " " + vR);
		}

		public Boolean stop()
		{
			return VRepProxy.Proxy.VRepProxy.Perform ("perform move 0 0");
		}
	}
}

