- Joined
- Sep 30, 2015
- Messages
- 86
- Thread Author
- #1
EDIT: Included a debug script at the bottom.
I've started creating my own Web for my API, and I cannot get it to work correctly. I'm currently trying to simply get Lodestones working.
2ND EDIT: Everything works perfectly if you switch vertex.addDirectedEdge(v, 25); to v.addDirectedEdge(vertext, 25);
Before:
After:
It appears to be using the lodestones like it should now, thanks @Aidden
I've started creating my own Web for my API, and I cannot get it to work correctly. I'm currently trying to simply get Lodestones working.
2ND EDIT: Everything works perfectly if you switch vertex.addDirectedEdge(v, 25); to v.addDirectedEdge(vertext, 25);
Before:
Code:
public void addLodestoneVertices() {
for (Lodestone lodestone : Lodestone.values()) {
LodestoneVertex vertex = new LodestoneVertex(lodestone);
Coordinate c = lodestone.getPosition().derive(0, -1);
WebVertex v = webCustom.getVertexNearestTo(c);
if (v != null) {
double dist = Distance.between(c, v.getPosition());
if (dist < 3) {
vertex.addDirectedEdge(v, 25);
webCustom.addVertices(vertex);
debug("Added: " + lodestone);
debug(v.distanceTo(vertex));
}
}
}
}
After:
Code:
public void addLodestoneVertices() {
for (Lodestone lodestone : Lodestone.values()) {
LodestoneVertex vertex = new LodestoneVertex(lodestone);
Coordinate c = lodestone.getPosition().derive(0, -1);
WebVertex v = webCustom.getVertexNearestTo(c);
if (v != null) {
double dist = Distance.between(c, v.getPosition());
if (dist < 3) {
v.addDirectedEdge(vertex, 25);
webCustom.addVertices(vertex);
debug("Added: " + lodestone);
debug(v.distanceTo(vertex));
}
}
}
}
It appears to be using the lodestones like it should now, thanks @Aidden
Attachments
Last edited: