/// <summary> /// Dessin de la partie supperieur de la fenetre /// </summary> /// <returns></returns> private string DrawMaps() { //Les inputs string retour = Map1.GetDoc(); bool j1playing = (tour % 2 == 0) ?true:false; uint width = ((uint)Map1.Matrice.GetLength(0)*2 + 3); string LineM1 = "", LineM2 = ""; int i = 0; LineM1 = map1.GetLine(i, j1playing); LineM2 = map2.GetLine(i, !j1playing); do { //debut du tour //On modifie les tailles LineM1 = (LineM1 == null)?"" :LineM1; if (LineM1.Length > width) LineM1.Substring(0, (int)width); else { while(LineM1.Length < width) { LineM1 += " "; } } LineM2 = (LineM2 == null) ? "" : LineM2; if (LineM2.Length > width) LineM2.Substring(0, (int)width); else { while (LineM2.Length < width) { LineM2 += " "; } } retour += LineM1 + " | " + LineM2 + "\n"; //Prochain tour i++; LineM1 = map1.GetLine(i, j1playing); LineM2 = map2.GetLine(i, !j1playing); } while (LineM1 != null && LineM2 != null); return retour; }