예제 #1
0
  public void clickOnMainMap(MouseEvent e) {

    // if button 3
    // on stack
    // on city
    // on empty hex
    // if button 1
    // on hex
    Point p = SU.getPlanetMapClickPoint(e);

    if (e.getButton() == MouseEvent.BUTTON1) {
      clickOnPlanetMapButton1(p);
    } else if (e.getButton() == MouseEvent.BUTTON3) {
      SU.clickOnPlanetMapButton3(p);
    }
  }
예제 #2
0
  public void clickOnPlanetMapButton1(Point p) {
    if (SU.disembarkNavalCargo(p) || SU.embarkNavalCargo(p)) {
      return;
    }
    LinkedList<Hex> path = game.getPath();
    if (p.x == path.getLast().getX() && p.y == path.getLast().getY()) {

      if (Util.moveCapable(game)) {

        // start stack movement loop
        gui.setCurrentState(PW4.get());
        gui.setMenus(null);
        gui.startStackMove();
      }

      //
    } else {
      SU.findPath(p);
      if (game.getPath() == null) {
        gui.setCurrentState(PW2.get());
      }
    }
  }
예제 #3
0
 //    public void clickOnPlanetWindow(MouseEvent e) {
 //        Point p = e.getPoint();
 //        if (SU.isOnStackDisplay(p)) {
 //            SU.clickOnStackDisplay(e);
 //        }
 //    }
 //        public void clickOnStackDisplay(MouseEvent e) {
 //        if (e.getButton() == MouseEvent.BUTTON1) {
 //            SU.clickOnStackDisplayButton1(e);
 //        } else if (e.getButton() == MouseEvent.BUTTON3) {
 //            // display stack window
 ////            gui.showStackWindow();
 //            SU.showUnitInfoWindow();
 //        }
 //    }
 public void wheelRotated(MouseWheelEvent e) {
   SU.wheelOnPlanetMap(e);
 }
예제 #4
0
 @Override
 public void razeCity() {
   SU.razeCitySU();
 }
예제 #5
0
 @Override
 public void pressTradeButton() {
   SU.pressTradeButtonSU();
 }
예제 #6
0
 @Override
 public void pressBuildButton() {
   SU.pressBuildButtonSU();
 }
예제 #7
0
 @Override
 public void pressLaunchButton() {
   SU.pressLaunchButtonSU();
 }
예제 #8
0
 /** Start new game */
 @Override
 public void pressStartNew() {
   SU.setWindow(C.S_MAIN_MENU);
   gui.setCurrentState(MM3.get());
 }