本文整理汇总了Java中POGOProtos.Map.Fort.FortDataOuterClass.FortData方法的典型用法代码示例。如果您正苦于以下问题:Java FortDataOuterClass.FortData方法的具体用法?Java FortDataOuterClass.FortData怎么用?Java FortDataOuterClass.FortData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POGOProtos.Map.Fort.FortDataOuterClass
的用法示例。
在下文中一共展示了FortDataOuterClass.FortData方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLuredPokestop
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public void addLuredPokestop(FortDataOuterClass.FortData data) {
if (fortExists(data.getId())) return;
LatLng location = new LatLng(data.getLatitude(), data.getLongitude());
PPokemon marker = new PPokemon();
marker.setId(location.toString());
luredPokemon.put(data.getId(), addPokemon(location, marker, data.getLureInfo().getActivePokemonId()));
addLuredPokestop(location, data.getId(), data.getLureInfo().getLureExpiresTimestampMs());
forts.add(data.getId());
}
示例2: getGyms
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public Collection<FortDataOuterClass.FortData> getGyms() {
try {
return getMap().getMapObjects().getGyms();
} catch (Exception e) {
e.printStackTrace();
}
return new ArrayList<>();
}
示例3: doInBackground
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... voids) {
PokemonGo go = MainActivity.go;
if (go == null)
return null;
long time = System.currentTimeMillis();
while (pos < settings.locations.size()) {
if (isCancelled()) return null;
go.setLatitude(settings.locations.get(pos).latitude);
go.setLongitude(settings.locations.get(pos).longitude);
pos++;
try {
Map map = new Map(go);
MapObjects objects = map.getMapObjects(9);
MapWrapper mapWrapper = new MapWrapper();
if (settings.pokemon)
mapWrapper.getPokemon().addAll(map.getCatchablePokemon());
if (settings.pokestops)
mapWrapper.getPokestops().addAll(objects.getPokestops());
if (settings.spawnpoints) {
mapWrapper.getSpawnpoints().addAll(map.getDecimatedSpawnPoints());
mapWrapper.getSpawnpoints().addAll(map.getSpawnPoints());
}
if (settings.gyms)
for (FortDataOuterClass.FortData fortdata : objects.getGyms()) {
if (!ids.contains(fortdata.getId())) {
Thread.sleep(350);
mapWrapper.getGyms().add(new PGym(new Gym(go, fortdata)));
ids.add(fortdata.getId());
}
}
publishProgress(mapWrapper);
if (objects.getPokestops().size() > 0) {
System.out.println("SUCCESSFUL REQUEST! TIME: " + (System.currentTimeMillis() - time) / 1000);
time = System.currentTimeMillis();
}
System.out.println("POKESTOP COUNT: " + objects.getPokestops().size());
System.out.println("SLEEPING " + ((long) go.getSettings().getMapSettings().getMinRefresh()));
//Thread.sleep((long) go.getSettings().getMapSettings().getMinRefresh());
Thread.sleep(6200);
//Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
示例4: addPokestop
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public void addPokestop(FortDataOuterClass.FortData data) {
if (fortExists(data.getId())) return;
addPokestop(new LatLng(data.getLatitude(), data.getLongitude()), data.getId());
}
示例5: setGymsMarkers
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
private void setGymsMarkers(final GymsEvent event){
if (mGoogleMap != null) {
int markerSize = getResources().getDimensionPixelSize(R.dimen.gym_marker);
Collection<FortDataOuterClass.FortData> gyms = event.getGyms();
if(gyms != null && mPref.getShowGyms()) {
Set<String> markerKeys = gymsList.keySet();
for (final FortDataOuterClass.FortData gym : gyms) {
double distanceFromCenterInMeters = MapHelper.distance(new LatLng(event.getLatitude(), event.getLongitude()), new LatLng(gym.getLatitude(), gym.getLongitude())) * 1000;
if (!markerKeys.contains(gym.getId()) && distanceFromCenterInMeters <= MapHelper.convertStepsToRadius(mPref.getSteps())) {
RemoteImageLoader.loadMapIcon(
getActivity(), gymTeamImageUrls.get(gym.getOwnedByTeam().getNumber()),
markerSize, markerSize,
new RemoteImageLoader.Callback() {
@Override
public void onFetch(Bitmap bitmap) {
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
Marker marker = mGoogleMap.addMarker(new MarkerOptions()
.position(new LatLng(gym.getLatitude(), gym.getLongitude()))
.title(getString(R.string.gym))
.icon(bitmapDescriptor)
.zIndex(MapHelper.LAYER_GYMS)
.anchor(0.5f, 0.5f));
// adding gyms to list to be removed on next search
gymsList.put(gym.getId(), new GymMarkerExtended(gym, marker));
}
}
);
}
}
}
updateMarkers();
} else {
showMapNotInitializedError();
}
}
示例6: GymMarkerExtended
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public GymMarkerExtended(FortDataOuterClass.FortData gym, Marker marker) {
this.gym = gym;
this.marker = marker;
}
示例7: getGym
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public FortDataOuterClass.FortData getGym() {
return gym;
}
示例8: setGym
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public void setGym(FortDataOuterClass.FortData gym) {
this.gym = gym;
}
示例9: GymsEvent
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public GymsEvent(Collection<FortDataOuterClass.FortData> gyms, double lat, double longitude) {
this.gyms = gyms;
this.lat = lat;
this.longitude = longitude;
}
示例10: getGyms
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public Collection<FortDataOuterClass.FortData> getGyms() {
return gyms;
}
示例11: setGyms
import POGOProtos.Map.Fort.FortDataOuterClass; //导入方法依赖的package包/类
public void setGyms(Collection<FortDataOuterClass.FortData> gyms) {
this.gyms = gyms;
}