Package civquest.util

Examples of civquest.util.Coordinate


        position = new Coordinate(x, y);
    }

  public Field(int x, int y, LoadedData loadedData, LoadingStep step)
    throws Exception {
    position = new Coordinate(x, y);
    this.loadedData = loadedData;
    setPersistentData(step);
  }
View Full Code Here


      pressure = loadedData.getInt("pressure", 0);
      temperature = loadedData.getInt("temp", 0);
      humidity = loadedData.getInt("hum", 1000);
      waterflow = loadedData.getInt("waterFlow", 0);
     
      Coordinate waterFlowToCoord = loadedData.getCoordinate("waterFlowTo");
      if (waterFlowToCoord != null) {
        setWaterFlowTo(waterFlowToCoord);
      }

      population = loadedData.getLong("population", 0l);
View Full Code Here

      boolean startOneLineAboveLeft = false;
      boolean startOneLineAboveRight = false;
      firstLeftDown = false;

      Coordinate unscrolledCoord1 = getUnscrolledArrayCoord(coord1);
      Coordinate unscrolledCoord2 = getUnscrolledArrayCoord(coord2);
      Coordinate paintCoord1 = getAbsPaintCoord(unscrolledCoord1);
      Coordinate paintCoord2 = getAbsPaintCoord(unscrolledCoord2);

      if (coord1.y < paintCoord1.y + halfCellHeight) {
        if (coord1.x < paintCoord1.x + halfCellWidth) {
          startOneLineAboveLeft = true;
        } else {
View Full Code Here

    public void actionPerformed(FunctionActionEvent e) {
//TODO Well, we don't care about the unitCombo. Add this!
        if (this.scenarioEditor.getSelectedTab() == UNIT_TAB) {
            //only proceed if the unitTab is selected
            Nation nation = this.scenarioEditor.getSelectedNation();
            Coordinate coordinate = this.map.getWorkingFieldPos();
            if (coordinate != null) {
                ConstructUnit newUnitChange = new ConstructUnit(
                        coordinate, nation.getID());
                newUnitChange.execute();
            }
View Full Code Here

      MapData mapData = Game.getMapData();

      PaintInfo retInfo = new PaintInfo();
      retInfo.setCoord((Coordinate)(currCoord.clone()));

      Coordinate scrolledCoord = adjustArrayCoordToScrolling(currCoord);
      retInfo.setFieldPos(scrolledCoord);

      do {
        stepForward();
      } while (!finished && !mapData.isOnMap(adjustArrayCoordToScrolling(currCoord)));
View Full Code Here

      return Coordinate.class.equals(value.getClass());
    }

    public String getAttributeValueString(Object value) {
      assert isResponsible(value);
      Coordinate c = (Coordinate)value;
      return Defs.getCoordinateCode() + Defs.getSeparator() + c.x
        + Defs.getSeparator() + c.y;     
    }
View Full Code Here

   
  }

  public void actionPerformed(ActionEvent event) {
    FieldView currFieldView = fieldViewManager.getCurrentFieldView();
    Coordinate coordInsideFV = fieldViewManager.getCoordInsideCurrentFieldView();

    System.out.println("FunctionAction says: Executing " + functionName
               + " with rel-coord " + coordInsideFV);
   
   
View Full Code Here

  public void actionPerformed(FunctionActionEvent event) {
    FieldView currFieldView = fieldViewManager.getCurrentFieldView();

    if (currFieldView != null) {
      Coordinate coordInsideFV = fieldViewManager.getCoordInsideCurrentFieldView();

      currFieldView.executeFunction(functionName, coordInsideFV);
    }
  }
View Full Code Here

  private void constructConstructCity() {
    Long cityID = Game.getMapData().getCityID(coord);

    if (cityID != null) {
      Coordinate location = Game.getMapData().getCityPosition(cityID);
      Long cityOwner = Game.getMapData().getCityOwner(cityID);
      if (!(manager.getNationID().equals(cityOwner))) {
        constructCity = new ConstructCity(manager.getResToNation(),
                          location, cityOwner);
      }
View Full Code Here

  /******************************** HasIDs *********************************/

  public void add(HasID hasID) {
    if (hasID instanceof Field) {
      Field f = (Field)hasID;
      Coordinate pos = f.getPosition();
      fields[pos.x][pos.y] = f;
    } else if (hasID instanceof MapObject) {
      // Fields are MapObjects, but we don't want to treat them as
      // MapObjects here (at least for now)
      addMapObject((MapObject)hasID);
View Full Code Here

TOP

Related Classes of civquest.util.Coordinate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.