public IA(NXTVehicule p_vehicule, bool p_simulation = false) { this.vehicule = p_vehicule; this.circuit = vehicule.Circuit; this.buffer = p_vehicule.Buffer; pStraight = new NXTAction(NXTMovement.STRAIGHT); pLeft = new NXTAction(NXTMovement.INTER_LEFT); pRight = new NXTAction(NXTMovement.INTER_RIGHT); pUturn = new NXTAction(NXTMovement.UTURN); }
// Met à jour la listBox1 pour afficher le buffer public void UpdateBuffer(NXTBuffer buffer) { if (this.listBox1.InvokeRequired) { var d = new SafeCallDelegate(UpdateBuffer); this.Invoke(d, new object[] { buffer }); } else { listBox1.Items.Clear(); foreach (NXTAction a in buffer) { listBox1.Items.Add(a.ToFancyString()); } } }