public class Target
extends java.lang.Object
The marker's color (hue, technically) changes to indicate the team owning it. The Google Maps marker's hue should be BitmapDescriptorFactory.HUE_RED for the red team, BitmapDescriptorFactory.HUE_YELLOW for the yellow team, BitmapDescriptorFactory.HUE_GREEN for the green team, BitmapDescriptorFactory.HUE_BLUE for the blue team, and BitmapDescriptorFactory.HUE_VIOLET if unclaimed.
Constructor and Description |
---|
Target(com.google.android.gms.maps.GoogleMap setMap,
com.google.android.gms.maps.model.LatLng setPosition,
int setTeam)
Creates a target in a target-mode game by placing an appropriately colored marker on the map.
|
Modifier and Type | Method and Description |
---|---|
com.google.android.gms.maps.model.LatLng |
getPosition()
Gets the position of the target.
|
int |
getTeam()
Gets the ID of the team currently owning this target.
|
void |
setTeam(int newTeam)
Updates the owning team of this target and updates the hue of the marker to match.
|
public Target(com.google.android.gms.maps.GoogleMap setMap, com.google.android.gms.maps.model.LatLng setPosition, int setTeam)
The marker's hue should reflect the team (if any) currently owning the target. See the class description for the hue values to use.
setMap
- the map to render tosetPosition
- the position of the targetsetTeam
- the TeamID code of the team currently owning the targetpublic com.google.android.gms.maps.model.LatLng getPosition()
public int getTeam()
public void setTeam(int newTeam)
newTeam
- the ID of the team that captured the target