Updated to use NeighborDrone instead of Neighbor
Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
parent
ebc5e74893
commit
891002c646
Binary file not shown.
@ -3,7 +3,7 @@ package net.grosinger.nomads.sampleDrone;
|
||||
import net.grosinger.nomads.Drone;
|
||||
import net.grosinger.nomads.DroneListItem.EnumMove;
|
||||
import net.grosinger.nomads.DroneTools;
|
||||
import net.grosinger.nomads.Neighbor;
|
||||
import net.grosinger.nomads.NeighborDrone;
|
||||
import net.grosinger.nomads.Upgrade;
|
||||
|
||||
public class SampleDrone implements Drone {
|
||||
@ -11,10 +11,10 @@ public class SampleDrone implements Drone {
|
||||
// You can change this if you want
|
||||
private static final boolean DEBUGGINGALL = true;
|
||||
|
||||
//Do not change these
|
||||
// Do not change these
|
||||
private String name;
|
||||
private String UID;
|
||||
|
||||
|
||||
// Define any variables that you need
|
||||
private DroneTools tools;
|
||||
|
||||
@ -29,17 +29,17 @@ public class SampleDrone implements Drone {
|
||||
public void setName(String newName) {
|
||||
name = newName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setUID(String newUID) {
|
||||
UID = newUID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return UID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setDroneTools(DroneTools newTools) {
|
||||
tools = newTools;
|
||||
@ -49,42 +49,38 @@ public class SampleDrone implements Drone {
|
||||
|
||||
@Override
|
||||
public EnumMove move() {
|
||||
if (DEBUGGINGALL){
|
||||
if (DEBUGGINGALL) {
|
||||
System.out.println("SampleDrone initiating move...");
|
||||
System.out.println("Current X = " + tools.getX());
|
||||
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();
|
||||
|
||||
|
||||
if (tools.canMoveEast())
|
||||
return EnumMove.East;
|
||||
else if (tools.canMoveSouth())
|
||||
return EnumMove.South;
|
||||
else if (tools.canMoveWest())
|
||||
return EnumMove.West;
|
||||
else if (tools.canMoveNorth())
|
||||
return EnumMove.North;
|
||||
else
|
||||
return EnumMove.NoMove;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Neighbor steal() {
|
||||
// TODO Auto-generated method stub
|
||||
public NeighborDrone steal() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Neighbor attack() {
|
||||
// TODO Auto-generated method stub
|
||||
public NeighborDrone attack() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Upgrade upgrade() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user