Package de.ailis.xadrian.data

Examples of de.ailis.xadrian.data.Sector


        final int x = e.getX() - (this.getWidth() - this.buffer.getWidth()) / 2;
        final int y = e.getY() - (this.getHeight() - this.buffer.getHeight()) / 2;
        final int sx = Math.round(((x / this.scale) - 75) / 100);
        final int sy = Math.round(((y / this.scale) - 75) / 100);

        final Sector sector = this.game.getSectorFactory().getSector(sx, sy);
        if (sector != this.overSector)
        {
            this.overSector = sector;
            repaint();
        }
View Full Code Here


     * @see ActionListener#actionPerformed(ActionEvent)
     */
    @Override
    public void actionPerformed(final ActionEvent e)
    {
        final Sector sector = this.sectorProvider.getSector();
        final SelectSectorDialog dialog =
            this.gameProvider.getGame().getSelectSectorDialog();
        dialog.setSelected(sector);
        if (dialog.open() == Result.OK)
            this.sectorProvider.setSector(dialog.getSelected());
View Full Code Here

                final String northId = element.attributeValue("north");
                final String eastId = element.attributeValue("east");
                final String southId = element.attributeValue("south");
                final String westId = element.attributeValue("west");

                final Sector sector;
                final List<?> switches = element.elements("switch");
                if (switches.size() == 0)
                {
                    final boolean shipyard = hasShipyard(element);
                    final Asteroid[] asteroids = getAsteroids(element);
                    sector =
                        new Sector(this.game, id, x, y, race, planets, suns,
                            core, shipyard, northId, eastId, southId, westId,
                            asteroids);
                }
                else
                {
                    final Asteroid[][] asteroidsList =
                        new Asteroid[switches.size()][];
                    int i = 0;
                    for (final Object switchItem : switches)
                    {
                        final Element switchElement = (Element) switchItem;
                        asteroidsList[i] = getAsteroids(switchElement);
                        i++;
                    }
                    sector =
                        new PlayerSector(this.game, id, x, y, race, planets,
                            suns, core, northId, eastId, southId, westId,
                            asteroidsList);
                }

                this.sectors.add(sector);
                this.sectorMap.put(id, sector);

                this.maxSiliconYield = Math.max(this.maxSiliconYield, sector
                    .getTotalSiliconYield());
                this.maxOreYield = Math.max(this.maxOreYield, sector
                    .getTotalOreYield());
                this.maxNividiumYield = Math.max(this.maxNividiumYield, sector
                    .getTotalNividiumYield());
                this.maxIceYield = Math.max(this.maxIceYield, sector
                    .getTotalIceYield());
            }
        }
        catch (final DocumentException e)
        {
View Full Code Here

TOP

Related Classes of de.ailis.xadrian.data.Sector

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.