Skip to content

Commit

Permalink
WIP #12: Add API to query connection between vessel nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brindamour committed Jan 18, 2016
1 parent bd60f17 commit e967b6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import net.dhleong.acl.vesseldata.Vessel;
import net.dhleong.acl.vesseldata.VesselData;
import net.dhleong.acl.vesseldata.VesselNode;
import net.dhleong.acl.vesseldata.VesselNodeConnection;
import net.dhleong.acl.world.Artemis;

public abstract class BaseEngineeringConsoleManager implements EngineeringConsoleManager {

private List<EngineeringConsoleChangeListener> listeners = new ArrayList<>();
private ShipSystemGrid shipSystemGrid;
private List<VesselNode> grid;
private List<VesselNodeConnection> gridConnections;


public BaseEngineeringConsoleManager() {
Expand All @@ -34,6 +36,11 @@ public BaseEngineeringConsoleManager() {
}
}

Iterator<VesselNodeConnection> connectionIterator = vessel.getInternals().connectionIterator();
while(connectionIterator.hasNext()) {
gridConnections.add(connectionIterator.next());
}

this.shipSystemGrid = shipSystemGrid;
}

Expand Down Expand Up @@ -62,6 +69,11 @@ public List<VesselNode> getGrid() {
return this.grid;
}

@Override
public List<VesselNodeConnection> getGridConnections() {
return this.gridConnections;
}

protected ShipSystemGrid getShipSystemGrid() {
return shipSystemGrid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.dhleong.acl.enums.ShipSystem;
import net.dhleong.acl.util.GridCoord;
import net.dhleong.acl.vesseldata.VesselNode;
import net.dhleong.acl.vesseldata.VesselNodeConnection;

public interface EngineeringConsoleManager {
int getTotalShipCoolant();
Expand All @@ -23,6 +24,8 @@ public interface EngineeringConsoleManager {
Map<GridCoord, Float> getGridHealth();

List<VesselNode> getGrid();

List<VesselNodeConnection> getGridConnections();

void setSystemEnergyAllocated(ShipSystem system, int amount);

Expand Down

0 comments on commit e967b6e

Please sign in to comment.