using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RaspiControl { internal class Navigation { private int angleRight; private int angleLeft; public Navigation() { this.angleRight = 0; this.angleLeft = 0; } public void ResetAngle() { this.angleRight = 0; this.angleRight= 0; } public int GetAngleLeftStep() { this.angleLeft -= 10; if (this.angleLeft < -180) { this.angleLeft = -180; } return -10; } public int GetAngleRightStep() { this.angleRight += 10; if (this.angleRight > 180) { this.angleRight = 180; } return 10; } public int IncreaseAngleLeft() { this.angleLeft -= 10; if(this.angleLeft < -180) { this.angleLeft = -180; } return this.angleLeft; } public int IncreaseAngleRight() { this.angleRight += 10; if (this.angleRight > 180) { this.angleRight = 180; } return this.angleRight; } } }