-Continued building move method in Police
Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
parent
2a764b5073
commit
9190e7c306
Binary file not shown.
@ -70,13 +70,26 @@ public class Police implements Drone {
|
||||
System.out.println("Policeman about to move");
|
||||
}
|
||||
|
||||
if(UIDofDroneIAmFollowing != null){
|
||||
//TODO
|
||||
}else if (iAmGoingToGiveBackup != null) {
|
||||
// If I am not at this point already, go there
|
||||
if (UIDofDroneIAmFollowing != null) {
|
||||
// Look to see if I can see that drone still, if I can then go
|
||||
// towards it.
|
||||
|
||||
// If I am at that point, unset the variable and start looking for
|
||||
// people
|
||||
for (NeighborDrone aDrone : tools.checkRadar()) {
|
||||
if (aDrone.getUID().equals(UIDofDroneIAmFollowing)) {
|
||||
// If I am within 1 space of it, attack
|
||||
// TODO
|
||||
// Else move towards it
|
||||
}
|
||||
}
|
||||
} else if (iAmGoingToGiveBackup != null) {
|
||||
// If I am not at this point already, go there
|
||||
if (!atPoint(iAmGoingToGiveBackup)) {
|
||||
return goToPoint(iAmGoingToGiveBackup);
|
||||
} else {
|
||||
// If I am at that point, unset the variable and start looking
|
||||
// for people
|
||||
iAmGoingToGiveBackup = null;
|
||||
}
|
||||
} else if (backupRequestedHere != null) {
|
||||
// Another policeman needs backup, go there
|
||||
EnumMove returnThis = goToPoint(backupRequestedHere);
|
||||
@ -192,4 +205,16 @@ public class Police implements Drone {
|
||||
return EnumMove.NoMove;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides if this police drone is at the point that is passed.
|
||||
*
|
||||
* @param here
|
||||
* A point to test for
|
||||
* @return <code>Boolean</code>
|
||||
*/
|
||||
private Boolean atPoint(Point here) {
|
||||
// TODO - Implement atPoint
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user