/// <summary> /// Predykat szuka zolnierzy, ktorzy znajduja sie na tile o indexie /// zadanym w parametrze. /// </summary> /// <param name="position">Index elementu planszy.</param> /// <returns>True - jesli zolnierz znjaduje sie na tym kawalku planszy, w przeciwnym /// przypadku false.</returns> public static Predicate <Soldier> FindSoldierByPosition(int position) { return(delegate(Soldier s) { int pos = Mathematics.PositionToIndex(s.Position.X); return pos == position; }); }
public static Predicate <General> FindGeneralFromInterval(int start, int end) { return(delegate(General s) { int pos = Mathematics.PositionToIndex(s.Position.X); return start <= pos && pos <= end; return false; }); }
public static Predicate <Soldier> FindSoldierFromInterval(int start, int end) { return(delegate(Soldier s) { int pos = Mathematics.PositionToIndex(s.Position.X); return start <= pos && pos <= end; return false; }); }