Skip to content

Commit

Permalink
WIP #12: Add API for moving damcon teams
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brindamour committed Jan 18, 2016
1 parent c2bb69c commit 453f44c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public interface EngineeringConsoleManager {
void incrementSystemEnergyAllocated(ShipSystem system, int amount);

void incrementSystemCoolantAllocated(ShipSystem system, int amount);

void moveDamconTeam(int teamId, GridCoord coord);

void addChangeListener(EngineeringConsoleChangeListener listener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ protected void updateSystemCoolantAllocated(ShipSystem system, int amount) {
fireChange();

}

@Override
public void moveDamconTeam(int teamId, GridCoord coord) {
// Not supported for now
}

@Override
public int getTotalShipCoolant() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import net.dhleong.acl.enums.ShipSystem;
import net.dhleong.acl.protocol.core.eng.EngGridUpdatePacket.DamconStatus;
import net.dhleong.acl.protocol.core.eng.EngSendDamconPacket;
import net.dhleong.acl.protocol.core.eng.EngSetCoolantPacket;
import net.dhleong.acl.protocol.core.eng.EngSetEnergyPacket;
import net.dhleong.acl.util.GridCoord;
Expand Down Expand Up @@ -129,4 +130,8 @@ protected void updateSystemEnergyAllocated(ShipSystem system, int amount) {
protected void updateSystemCoolantAllocated(ShipSystem system, int amount) {
this.worldAwareRobustProxyListener.getServer().send(new EngSetCoolantPacket(system, amount));
}

public void moveDamconTeam(int teamId, GridCoord coord) {
this.worldAwareRobustProxyListener.getServer().send(new EngSendDamconPacket(teamId, coord));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.brindyblitz.artemis.engconsole.ui.damcon.Damcon;

import net.dhleong.acl.enums.ShipSystem;
import net.dhleong.acl.util.GridCoord;

public class UserInterfaceFrame extends JFrame implements KeyListener {

Expand Down Expand Up @@ -129,6 +130,9 @@ public void keyPressed(KeyEvent e) {
}

System.out.println("\n\n\n");
} else if (kc == KeyEvent.VK_EQUALS) {
System.out.println("Sending damcon team");
this.engineeringConsoleManager.moveDamconTeam(0, GridCoord.getInstance(2, 2, 5));
} else if (kc == KeyEvent.VK_BACK_QUOTE) {
if (e.isShiftDown()) {
this.damcon.toggleDamageShake();
Expand Down

0 comments on commit 453f44c

Please sign in to comment.