Wegfindung wird jetzt ausgeführt, wenn auf ein Feld auf der Karte geklickt wird
This commit is contained in:
@@ -13,6 +13,11 @@ namespace WorldOfPeacecraft
|
||||
Coords = null;
|
||||
}
|
||||
|
||||
public bool HasMoreSteps()
|
||||
{
|
||||
return Coords != null && Coords.Count >= 2;
|
||||
}
|
||||
|
||||
public string NextStep ()
|
||||
{
|
||||
if (Coords == null) {
|
||||
@@ -30,13 +35,13 @@ namespace WorldOfPeacecraft
|
||||
}
|
||||
string command;
|
||||
if (src.X > dst.X) {
|
||||
command = "mv:dwn";
|
||||
} else if (src.X < dst.X) {
|
||||
command = "mv:up";
|
||||
} else if (src.Y > dst.Y) {
|
||||
command = "mv:lft";
|
||||
} else if (src.Y < dst.Y) {
|
||||
} else if (src.X < dst.X) {
|
||||
command = "mv:rgt";
|
||||
} else if (src.Y > dst.Y) {
|
||||
command = "mv:up";
|
||||
} else if (src.Y < dst.Y) {
|
||||
command = "mv:dwn";
|
||||
} else {
|
||||
command = NextStep ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user