Exemple #1
0
 public CastleByDistanceModel GetNearestCastle(List <string> castles, double lat, double lng)
 {
     return(Castles.Where(c => castles.Contains(c.Id)).Select(c => new CastleByDistanceModel
     {
         Castle = c,
         Distance = MapHelpers.GetDistance(c.Position.Lat, c.Position.Lng, lat,
                                           lng)
     }).OrderBy(d => d.Distance).First());
 }
Exemple #2
0
        public List <string> GetOpponentCastlesId()
        {
            var myArmy = GetMyArmy();

            return(Castles.Where(e => e.Army != myArmy).Select(e => e.Id).ToList());
        }
Exemple #3
0
        public List <CastleStateModel> GetMyCastles()
        {
            var myArmy = GetMyArmy();

            return(Castles.Where(e => e.Army == myArmy).ToList());
        }