Package civquest.map.mapobj

Examples of civquest.map.mapobj.MapObject


  private void drawDetailInformation(Graphics g, Long unitID,
                     int x, int y, int width) {
    MapObjectReader moReader = gameData.getMapObjectReader();
    if (moReader.asMapObjectAvailable(unitID)) {
      MapObject mo = moReader.getAsMapObject(unitID);
      detailPainter.set(g, x, y, mo);
      try {
        detailCaller.callV(detailPainter, mo);
      } catch (MethodCallerException e) {
        Messages.getMessages().err("DetailedUnitInfoComponent", "Problem with "
View Full Code Here


    private void drawDetailInformation(Graphics g, Long unitID,
                                       int x, int y, int width) {
        MapObjectReader moReader = gameData.getMapObjectReader();
        if (moReader.asMapObjectAvailable(unitID)) {
            MapObject mo = moReader.getAsMapObject(unitID);
            detailPainter.set(g, x, y, mo);
            try {
                detailCaller.callV(detailPainter, mo);
            } catch (MethodCallerException e) {
                Messages.getMessages().err("DetailedUnitInfoComponent", "Problem with "
View Full Code Here

        RestrictedToNation resToNation = qMap.getGameData()
            .getRestrictedToNation();
        Iterator<MapObject> moit = mapObjects.iterator();
        for (;moit.hasNext();) {
            MapObject mapObject = moit.next();
            if (mapObject instanceof City) {
                RemoveCity remove = new RemoveCity(resToNation,
                        mapObject.getID());
                remove.execute();
            } else if (mapObject instanceof Unit) {
                RemoveUnit remove = new RemoveUnit(resToNation,
                        mapObject.getID());
                remove.execute();
            }
        }
        qMap.getFieldView(Game.getGame(), coordinate).dataChanged();
    }
View Full Code Here

           
            JPanel objectsPanel = new JPanel();
            objectsPanel.setLayout(new GridLayout(0, 1));
            for (int i = 0; i<mapObjects.size(); i++) {
                JPanel rowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
                MapObject mo = this.mapObjects.get(i);
                this.checkBoxes.add(new JCheckBox());
                this.objectLabels.add(new JLabel(mo.getModelName()));

                rowPanel.add(this.checkBoxes.get(i));
                rowPanel.add(this.objectLabels.get(i));
                objectsPanel.add(rowPanel);
            }
View Full Code Here

      = loadedData.getLoadedDataHashSet("mapObjects");
    for (LoadedData moLoadedData : moLoadedDataSet) {
      String modelName
        = moLoadedData.getString(MapObject.MODEL_NAME_KEY);

      MapObject newMapObject = null;
      // hack to make it run - TODO: think about a more elegant way of
      // mapping model names to the appropriate constructor call
      if (modelName.equals("units_musketeer")) {
        newMapObject = new Musketeer(moLoadedData, step);
      } else if (modelName.equals("city")) {
        newMapObject = new City(moLoadedData, step);
      }
      mapObjects.add(newMapObject);
      newMapObject.setField(this);
    }
  } 
View Full Code Here

    public void execute() {
        notifyBefore();

        Iterator<MapObject> moit = mapObjects.iterator();
        for (;moit.hasNext();) {
            MapObject mapObject = moit.next();
            if (mapObject instanceof City) {
                RemoveCity remove = new RemoveCity(this.map.getGameData().getRestrictedToNation(), mapObject.getID());
                remove.execute();
            } else if (mapObject instanceof Unit) {
                RemoveUnit remove = new RemoveUnit(this.map.getGameData().getRestrictedToNation(), mapObject.getID());
                remove.execute();
            }
        }
        notifyAfter();
        try {
View Full Code Here

TOP

Related Classes of civquest.map.mapobj.MapObject

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.