1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 15:06:06 +00:00

Correction filtre challenge

This commit is contained in:
Yan Maniez 2018-06-26 23:14:25 +02:00
parent 9e2af2895a
commit 7566930424

View file

@ -22,11 +22,11 @@ namespace AideDeJeu.Tools
if (string.IsNullOrEmpty(x) && string.IsNullOrEmpty(y)) return 0;
if (string.IsNullOrEmpty(x)) return 1;
if (string.IsNullOrEmpty(y)) return -1;
var regex = new Regex(@"\((?<xp>\d*?) (PX|XP)\)");
var regex = new Regex(@"\((?<xp>\d?\d?\d?\s?\d?\d?\d??) (PX|XP)\)");
int xpx;
int.TryParse(regex.Match(x).Groups["xp"].Value, out xpx);
int.TryParse(regex.Match(x).Groups["xp"].Value.Replace(" ",""), out xpx);
int xpy;
int.TryParse(regex.Match(y).Groups["xp"].Value, out xpy);
int.TryParse(regex.Match(y).Groups["xp"].Value.Replace(" ",""), out xpy);
return xpx - xpy;
}
}