1
0

Updated to use NeighborDrone instead of Neighbor

Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
Tony Grosinger 2011-09-10 22:36:27 -07:00
parent ebc5e74893
commit 891002c646
2 changed files with 15 additions and 19 deletions

View File

@ -3,7 +3,7 @@ package net.grosinger.nomads.sampleDrone;
import net.grosinger.nomads.Drone; import net.grosinger.nomads.Drone;
import net.grosinger.nomads.DroneListItem.EnumMove; import net.grosinger.nomads.DroneListItem.EnumMove;
import net.grosinger.nomads.DroneTools; import net.grosinger.nomads.DroneTools;
import net.grosinger.nomads.Neighbor; import net.grosinger.nomads.NeighborDrone;
import net.grosinger.nomads.Upgrade; import net.grosinger.nomads.Upgrade;
public class SampleDrone implements Drone { public class SampleDrone implements Drone {
@ -11,7 +11,7 @@ public class SampleDrone implements Drone {
// You can change this if you want // You can change this if you want
private static final boolean DEBUGGINGALL = true; private static final boolean DEBUGGINGALL = true;
//Do not change these // Do not change these
private String name; private String name;
private String UID; private String UID;
@ -49,15 +49,10 @@ public class SampleDrone implements Drone {
@Override @Override
public EnumMove move() { public EnumMove move() {
if (DEBUGGINGALL){ if (DEBUGGINGALL) {
System.out.println("SampleDrone initiating move..."); System.out.println("SampleDrone initiating move...");
System.out.println("Current X = " + tools.getX()); System.out.println("Current X = " + tools.getX());
System.out.println("Current Y = " + tools.getY()); System.out.println("Current Y = " + tools.getY());
if(tools.inSafeZone()){
System.out.println("I am in a safe zone");
}else{
System.out.println("I am not in a safe zone");
}
} }
tools.checkRadar(); tools.checkRadar();
@ -66,25 +61,26 @@ public class SampleDrone implements Drone {
return EnumMove.East; return EnumMove.East;
else if (tools.canMoveSouth()) else if (tools.canMoveSouth())
return EnumMove.South; return EnumMove.South;
else if (tools.canMoveWest())
return EnumMove.West;
else if (tools.canMoveNorth())
return EnumMove.North;
else else
return EnumMove.NoMove; return EnumMove.NoMove;
} }
@Override @Override
public Neighbor steal() { public NeighborDrone steal() {
// TODO Auto-generated method stub
return null; return null;
} }
@Override @Override
public Neighbor attack() { public NeighborDrone attack() {
// TODO Auto-generated method stub
return null; return null;
} }
@Override @Override
public Upgrade upgrade() { public Upgrade upgrade() {
// TODO Auto-generated method stub
return null; return null;
} }
} }