Package civquest.map

Examples of civquest.map.MapData


  public BlackWhiteVisibilityManager(Registry visRegistry, Nation nation)
    throws RulesetException {

    performCommonSetup(visRegistry, nation);
   
    MapData mapData = Game.getMapData();
    visibilityLevels = new int[mapData.getArrayWidth()][mapData.getArrayHeight()];

    loadSettings(visRegistry);

    initVisibility();   
  }
View Full Code Here


    }
  }


  public void makeCompleteVisible(Coordinate pos, int visDistance) {
    MapData mapData = Game.getMapData();

    for (int x = pos.x - visDistance; x <= pos.x + visDistance; x++) {
      for (int y = pos.y - visDistance; y <= pos.y + visDistance; y++) {
        if (mapData.isOnMap(x,y)) {
          // everything which is on map is inside the array, so no
          // test for the array-bounds should be required

          makeCompleteVisible(new Coordinate(x, y));
        }
View Full Code Here

    if (step == LoadingStep.CONSTRUCT) {
      unitVisibilityDistance = loadedData.getInt("unitVisDist");
      cityVisibilityDistance = loadedData.getInt("cityVisDist");
      useTerrainVisibility = loadedData.getBoolean("useTerrainVis");
    } else if (step == LoadingStep.REFERENCE) {
      MapData mapData = Game.getMapData();
      visibilityLevels = new int[mapData.getArrayWidth()][mapData.getArrayHeight()];
      initVisibility();         
    }
  }
View Full Code Here

            temp.add(new Coordinate(x-1, y+1));
            temp.add(new Coordinate(x, y+1));
            temp.add(new Coordinate(x+1, y+1));
            temp.add(wf);

            MapData mapData = Game.getMapData();
            for (int i = 0; i < temp.size(); i++) {
                Coordinate coord = temp.get(i);
                if (mapData.isOnMap(coord)) {
                    coords.add(coord);
                }
            }
            Long[] fieldIDs = new Long[temp.size()];
            for (int i = 0; i < coords.size(); i++) {
                fieldIDs[i] = mapData.getFieldID(coords.get(i));
            }

            if (group.getFields().contains(wf)) {
                //unmark fields
                UnmarkField unmarkField = new UnmarkField(group, coords, fieldIDs);
View Full Code Here

    assert false : "Not yet implemented";
    return null;
  }

    private void constructLayeredFV() {
    MapData mapData = Game.getMapData();   
//         fieldViews = new QuadFlatLayeredFieldView[mapData.getArrayWidth()][mapData.getArrayHeight()];
//         for (int x = 0; x < mapData.getArrayWidth(); x++) {
//             for (int y = 0; y < mapData.getArrayHeight(); y++) {
//                 if (mapData.isArrayCoordOnMap(x, y)) {
//           if (validFieldViewCoord == null) {
View Full Code Here

    }


 
    public Coordinate getScrollSize() {
    MapData mapData = Game.getMapData();   
        return new Coordinate(mapData.getMapWidth() * cellWidth, mapData.getMapHeight() * cellHeight);
    }
View Full Code Here

    }

    public Coordinate adjustArrayCoordToScrolling(Coordinate coord) {
    Coordinate retCoord = (Coordinate)(coord.clone());

    MapData mapData = Game.getMapData();
    if (!mapData.isFlatEarth()) {
      while (retCoord.x < 0) {
        retCoord.x += mapData.getMapWidth();
      }
      while (retCoord.x >= mapData.getMapWidth()) {
        retCoord.x -= mapData.getMapWidth();
      }
    }
    return retCoord;
    }
View Full Code Here

    public Coordinate getUnscrolledArrayCoord(Coordinate paintCoord) {
    return new Coordinate(paintCoord.x / cellWidth, paintCoord.y / cellHeight);
    }

    public civquest.map.Field getFieldByAbs(Coordinate paintCoord) {
    MapData mapData = Game.getMapData();   
    Coordinate coord = adjustArrayCoordToScrolling(getUnscrolledArrayCoord(paintCoord));
    return (mapData.isOnMap(coord) ? mapData.getField(coord) : null);
    }
View Full Code Here

   (description copied from Properties)
   @param buffer any Buffer
   */
  public void updateDirtyFields(Buffer buffer, BufferManager bufferManager)
    throws InvalidImageException {
    MapData mapData = Game.getMapData();
   
    Coordinate fieldStart = buffer.getFieldRect().getTopLeftCorner();
    boolean[][] markedFields = buffer.getMarkedFields();
    Graphics2D graphics = buffer.getGraphics();
   
View Full Code Here

        endCoord.y = tmp;
      }

      currCoord = (Coordinate)(startCoord.clone());

      MapData mapData = Game.getMapData();
      while (!finished && !mapData.isOnMap(adjustArrayCoordToScrolling(currCoord))) {
        stepForward();
      }     
    }
View Full Code Here

TOP

Related Classes of civquest.map.MapData

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.