Examples of MapData


Examples of civquest.map.MapData

   (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

Examples of civquest.map.MapData

        endCoord.y = tmp;
      }

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

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

Examples of civquest.map.MapData

    public Object next() {
      if (finished) {
        throw new NoSuchElementException();       
      }

      MapData mapData = Game.getMapData();
      PaintInfo retInfo = new PaintInfo();
      retInfo.setCoord((Coordinate)(currCoord.clone()));
       
      Coordinate scrolledCoord = adjustArrayCoordToScrolling(currCoord);
      retInfo.setFieldPos(mapData.isOnMap(scrolledCoord) ? scrolledCoord : null);
       
      do {
        stepForward();
      } while (!finished && !mapData.isOnMap(adjustArrayCoordToScrolling(currCoord)));
       
      return retInfo;
    }
View Full Code Here

Examples of civquest.map.MapData

    notifyBefore();

    System.out.println("before done");
   

    MapData mapData = Game.getMapData();
    Unit unit = mapData.getUnit(unitID);

    // performs all necessary datastructure-upgrades (references
    // Field -> Unit, etc.)
    Game.getGame().remove(unit);
View Full Code Here

Examples of civquest.map.MapData

  public void execute() {
    notifyBefore();

    Game game = Game.getGame();
        Messages messages = Messages.getMessages();
        MapData mapData = Game.getMapData();
        Field field = mapData.getField(location);
        Nation nation = game.getNation(owner);

        Iterator<Unit> unitsIt = field.getUnitIterator();
        if (unitsIt.hasNext()) {
            Unit unit = unitsIt.next();
View Full Code Here

Examples of civquest.map.MapData

  public RestrictedToNation[] getResToNations() {
    return new RestrictedToNation[] {new RestrictedToNation()};
  }

  public void afterGameChanged(SetMapObjectHealth change) {
    MapData mapData = Game.getMapData();
    if (mapData.isUnit(change.getMapObject())) {
      if (change.getHealth() <= 0) {
        Messages.getMessages().info("DUnitDestroyManager", "Destroy",
                      "Destroying unit " + change.getMapObject()
                      + " because it has only " + change.getHealth()
                      + " (owner was: "
                      + mapData.getUnit(change.getMapObject())
                      .getOwner());
        RemoveUnit rmUnit = new RemoveUnit(change.getMapObject());
        rmUnit.execute();
        Messages.getMessages().info("DUnitDestroyManager", "Destroy",
                      "Destroying done");
View Full Code Here

Examples of civquest.map.MapData

           Mode mode, JScrollPane scrollPane, Session session)
    throws RulesetException {

        super(registry, topImageSet);

    MapData mapData = Game.getMapData();
 
        this.owner = owner;
    this.gameDataAccessor = gameDataAccessor;   
    this.mode = mode;
        this.scrollPane = scrollPane;
View Full Code Here

Examples of civquest.map.MapData

      Long aCityID = iterator.next();
      Coordinate aCityPos
        = cityReader.getCityPosition(aCityID);
      center(aCityPos);
    } else {
      MapData mapData = Game.getMapData();
      Coordinate centerPos = new Coordinate(mapData.getArrayWidth() / 2,
                          mapData.getArrayHeight() / 2);
      center(centerPos);
    }
  }
View Full Code Here

Examples of civquest.map.MapData

    private Coordinate adjustShowPosition(Coordinate showPosition, Coordinate showSize) {

        Coordinate maxShowPos;
        Coordinate scrollSize = properties.getScrollSize();
    MapData mapData = Game.getMapData();
   
        if (mapData.isFlatEarth()) {
            maxShowPos = properties.getPaintSize().sub(showSize);
        } else {
            maxShowPos = (Coordinate)(scrollSize.clone());
        }

        if (mapData.isFlatEarth()) {
            if (showPosition.x < 0) {
                showPosition.x = 0;
            } else if (showPosition.x >= maxShowPos.x) {
                showPosition.x = maxShowPos.x;
            }
View Full Code Here

Examples of civquest.map.MapData

    void markFieldForUpdate(GameDataAccessor gameData, Coordinate fieldPos) {
    civquest.util.Rectangle paintRect
      = properties.getAbsImagePaintRectangle(fieldPos);
   
    MapData mapData = Game.getMapData();
    if (!mapData.isFlatEarth()) {
      Coordinate scrollSize = properties.getScrollSize();

      if (totalBufferedSize != null) {
        if (paintRect.getX1() + scrollSize.x < totalBufferedSize.x) {
          bufferManager
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.