Examples of MapData


Examples of civquest.map.MapData

  public void afterGameChanged(SetFieldRuledByCity change) {
    TurnManager turnManager = Game.getGame().getTurnManager();
    Nation currNation = turnManager.getActiveNation();
   
    Coordinate position = change.getPosition();
    MapData mapData = Game.getMapData();
    Field field = mapData.getField(position);
    Long cityID = change.getCityID();
    City city = mapData.getCity(cityID);

    throw new ResourceGraphException("Re-implement this!");
//     ResourceDistribution distribution = null;
//     ResourceDistribution distribution = city.getResourceDistribution();
View Full Code Here

Examples of civquest.map.MapData

     
    return new Coordinate((int)(Math.floor(tx)), (int)(Math.floor(ty)));
    }

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

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();

    Rectangle fieldRect = buffer.getFieldRect();

    Coordinate fieldStart = fieldRect.getTopLeftCorner();
    boolean[][] markedFields = buffer.getMarkedFields();
View Full Code Here

Examples of civquest.map.MapData

      startCoord = (Coordinate)(lineStartCoord.clone());
      currCoord = (Coordinate)(lineStartCoord.clone());
      endCoord = unscrolledCoord2;

      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(scrolledCoord);

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

      return retInfo;
    }
View Full Code Here

Examples of civquest.map.MapData

  private Long nationID = null;

  public RemoveUnit(Long unitID) {
    super(unitID);

    MapData mapData = Game.getMapData();
    Coordinate coord = mapData.getMapObjectPosition(unitID);
    addFieldID(mapData.getFieldID(coord));
    this.nationID = mapData.getMapObjectOwner(unitID);
    addNationID(this.nationID);
    this.unitID = unitID;
  }
View Full Code Here

Examples of civquest.map.MapData

    this.unitID = unitID;
  }

  public RemoveUnit(RestrictedToNation resToNation, long unitID) {
    super(resToNation, unitID);
    MapData mapData = Game.getMapData();
    Coordinate coord = mapData.getMapObjectPosition(unitID);
    addFieldID(mapData.getFieldID(coord));
    this.nationID = mapData.getMapObjectOwner(unitID);
    addNationID(nationID);
    this.unitID = unitID;
  }
View Full Code Here

Examples of civquest.map.MapData

    JScrollPane scrollPane = null;
    QuadMap map = null;
    try {
       scrollPane = new JScrollPane();

       MapData mapData = Game.getMapData();

       if(mapData instanceof FlatMapData) {
         map = new QuadMap(civQuest,
                   registry, topImageSet, Const.FLAT,
                  QuadMap.Mode.GAME,
View Full Code Here

Examples of civquest.map.MapData

    JScrollPane scrollPane = null;
    QuadMap map = null;
    try {
       scrollPane = new JScrollPane();

       MapData mapData = Game.getMapData();


       if(mapData instanceof FlatMapData) {
         map = new QuadMap(civQuest, Game.getGame(),
                   registry, topImageSet, Const.FLAT,
View Full Code Here

Examples of civquest.map.MapData

  }

  public void execute() {
      notifyBefore();
      Messages messages = Messages.getMessages();
        MapData mapData = Game.getMapData();

        Field field = mapData.getField(location);
        Nation nation = Game.getGame().getNation(ownerNation);

        Iterator<Unit> unitsIt = field.getUnitIterator();
        if (unitsIt.hasNext()) {
            Unit unit = unitsIt.next();
            if (!unit.getOwner().equals(nation)) {
                messages.err("ConstructCity", "You try to build a city " +
                        "on a field where another nation's unit is located.");
                return;
            }
        }
       
        if (field.getCityOnField() != null &&
                !field.getCityOnField().getOwner().equals(nation)) {
            messages.err("ConstructCity", "You try to build a city " +
            "on a field where another nation's city is located.");
            return;
        }

        City city = new City(field, "New City");
    Game.getGame().add(city);
    mapData.setCityOwner(city, nation);
//         mapData.addCity(city, field, nation);

        setCityID(city.getID());
       
      notifyAfter();
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.