Changed to account for overhaul of Nomads
Signed-off-by: Tony Grosinger <github2@grosinger.net>
This commit is contained in:
parent
f5646c5cae
commit
893faa9140
@ -2,6 +2,6 @@
|
|||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/tgrosinger/Dropbox/Programming/Java/Nomads/Nomads-0.0.1.jar"/>
|
<classpathentry kind="lib" path="C:/Users/tgrosinger/Dropbox/Programming/Java/Nomads-Sample-Drone/Nomads.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
Binary file not shown.
@ -1,20 +1,46 @@
|
|||||||
package net.grosinger.nomads.sampleDrone;
|
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.DroneTools;
|
||||||
|
|
||||||
public class SampleDrone extends Drone {
|
public class SampleDrone implements Drone {
|
||||||
|
|
||||||
|
// You can change this if you want
|
||||||
private static final boolean DEBUGGINGALL = true;
|
private static final boolean DEBUGGINGALL = true;
|
||||||
|
|
||||||
/*
|
// Define any variables that you need
|
||||||
* Override the move method. This is your main way of doing anything
|
private DroneTools tools;
|
||||||
*/
|
private String name;
|
||||||
|
|
||||||
|
// Leave these methods alone, they are required //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void move() {
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setName(String newName) {
|
||||||
|
name = newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDroneTools(DroneTools newTools) {
|
||||||
|
tools = newTools;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit from here down //
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumMove move() {
|
||||||
if (DEBUGGINGALL)
|
if (DEBUGGINGALL)
|
||||||
System.out.println("SampleDrone initiating move...");
|
System.out.println("SampleDrone initiating move...");
|
||||||
|
if (tools.canMoveEast())
|
||||||
if (DEBUGGINGALL)
|
return EnumMove.East;
|
||||||
System.out.println("SampleDrone finished move");
|
else if (tools.canMoveSouth())
|
||||||
|
return EnumMove.South;
|
||||||
|
else
|
||||||
|
return EnumMove.NoMove;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user