private SniperInfo map(TrackemonResult result)
        {
            SniperInfo sniperInfo = new SniperInfo();
            PokemonId  pokemonId  = PokemonParser.parseById(result.id);

            sniperInfo.Id = pokemonId;

            sniperInfo.Latitude  = result.latitude;
            sniperInfo.Longitude = result.longitude;


            sniperInfo.ExpirationTimestamp = DateTime.Now.AddTicks(result.expiration);
            return(sniperInfo);
        }
示例#2
0
        private static SniperInfo Map(TrackemonResult result)
        {
            var sniperInfo = new SniperInfo();
            var pokemonId  = PokemonParser.ParseById(result.id);

            sniperInfo.Id = pokemonId;

            sniperInfo.Latitude    = Math.Round(result.latitude, 7);
            sniperInfo.Longitude   = Math.Round(result.longitude, 7);
            sniperInfo.ChannelInfo = new ChannelInfo {
                server = Channel
            };

            var timeStamp = DateTime.Now.AddTicks(result.expiration);

            sniperInfo.ExpirationTimestamp = DateTime.Now.AddMinutes(Constants.MaxExpirationInTheFuture) < timeStamp?
                                             DateTime.Now.AddMinutes(Constants.MaxExpirationInTheFuture) : timeStamp;

            return(sniperInfo);
        }
        private SniperInfo map(TrackemonResult result)
        {
            SniperInfo sniperInfo = new SniperInfo();
            PokemonId pokemonId = PokemonParser.parseById(result.id);
            sniperInfo.Id = pokemonId;

            sniperInfo.Latitude = result.latitude;
            sniperInfo.Longitude = result.longitude;

            sniperInfo.ExpirationTimestamp = DateTime.Now.AddTicks(result.expiration);
            return sniperInfo;
        }