Skip to content

Commit

Permalink
WIP #12: issue DAMCON orders via EngineringConsoleManager
Browse files Browse the repository at this point in the history
- I haven't tested it on a live server yet
  • Loading branch information
jacobmaxfrank committed Jan 30, 2016
1 parent e086ff4 commit c96a811
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,21 @@ public int getMembers() {
}

public float getX() {
return x;
return this.x;
}

public float getY() {
return y;
return this.y;
}

public float getZ() {
return z;
return this.z;
}

@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("Team #").append(getTeamNumber())
.append(" (").append(getMembers()).append("): ")
.append(" (").append(x).append(", ").append(y).append(", ").append(z).append(")");
return b.toString();
return "Team #" + getTeamNumber() + " (" + getMembers() + ") @ " +
"(" + this.x + "," + this.y + "," + this.z + ")";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ protected void updateSystemCoolantAllocated(ShipSystem system, int amount) {

@Override
public void moveDamconTeam(int teamId, GridCoord coord) {
System.out.println("Moving DAMCON team " + teamId + " to grid " + coord);
// Not supported for now
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void mouseClicked(MouseEvent e) {
selected = (InternalTeam)internal;
} else { // if (internal.getClass().equals(InternalNode.class))
if (selected != null) {
selected.setOrders((InternalNode)internal);
this.engineeringConsoleManager.moveDamconTeam(selected.getTeamID(), ((InternalNode)internal).getGridCoords());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.geometry.Sphere;
import net.dhleong.acl.util.GridCoord;
import net.dhleong.acl.vesseldata.VesselNode;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import javax.media.j3d.*;
import javax.vecmath.*;
import java.util.Objects;

public class InternalNode extends InternalSelectable {
private VesselNode vesselNode;
Expand Down Expand Up @@ -58,6 +60,10 @@ private boolean isSystemNode() {
return this.vesselNode.getSystem() != null;
}

public GridCoord getGridCoords() {
return this.vesselNode.getGridCoord();
}

@Override
public String toString() {
return "Node: " + this.vesselNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ protected boolean selected() {
return this.selected;
}

public void setOrders(InternalNode target) {
System.out.println("Ordering " + this + " to " + target);
public int getTeamID() {
return status.getTeamNumber();
}

@Override
Expand Down

0 comments on commit c96a811

Please sign in to comment.