コード例 #1
0
ファイル: Predicates.cs プロジェクト: wof2/Wings-Of-Fury-2
 /// <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;
     });
 }
コード例 #2
0
ファイル: Predicates.cs プロジェクト: wof2/Wings-Of-Fury-2
        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;
            });
        }
コード例 #3
0
ファイル: Predicates.cs プロジェクト: wof2/Wings-Of-Fury-2
        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;
            });
        }