コード例 #1
0
ファイル: DBWrapper.cs プロジェクト: bpeck81/Cloudclub_v1
        ///Returns the clouds that are available for the user's location
        public async Task<List<Cloud>> GetAvailableClouds(double latitude, double longitude)
        {
            var clouds = new List<Cloud>();

            //get clouds
            clouds = await cloudTable.ToListAsync();

            //remove if not in range
            for (int i = (clouds.Count-1); i>=0;i-- )
            {
                var dist = Distance(clouds[i].Latitude,clouds[i].Longitude,latitude,longitude);
                if(!(dist<clouds[i].Radius)){
                    clouds.RemoveAt(i);
                }
            }

            return clouds;
        }