Package worldBuilder

Class JsonExporter

  • All Implemented Interfaces:
    Exporter

    public class JsonExporter
    extends java.lang.Object
    implements Exporter
    Exporter to render a Cartesian map w/JSON descriptions of each point.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonExporter​(int width, int height)
      create a new Raw JSON exporter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void erodeMap​(double[][] erode)
      Up-load the net erosion/deposition for every tile
      int export_height()
      return the export height (in tiles)
      int export_width()
      return the export width (in tiles)
      void faunaMap​(double[][] fauna, java.lang.String[] names)
      Up-load the fauna type for every tile
      void floraMap​(double[][] flora, java.lang.String[] names)
      Up-load the flora type for every tile
      void heightMap​(double[][] heights)
      Up-load the altitude of every tile
      int neededInfo()
      return list of needed map up-loads
      void position​(double lat, double lon)
      Set the lat/lon of the region being exported
      void preview​(Exporter.WhichMap chosen, java.awt.Color[] colorMap)
      generate a preview of the currently up-loaded export
      void rainMap​(double[][] rain)
      Up-load the annual rainfall for every tile
      void soilMap​(double[][] soil, java.lang.String[] names)
      Up-load the soil type for every tile
      void temps​(double meanTemp, double meanSummer, double meanWinter)
      Set seasonal temperature range for region being exported
      void tileSize​(int meters)
      Set the size of a single tile
      void waterMap​(double[][] depths)
      Up-load the surface-water-depth for every tile
      boolean writeFile​(java.lang.String filename)
      Export the up-loaded information in selected format
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonExporter

        public JsonExporter​(int width,
                            int height)
        create a new Raw JSON exporter
        Parameters:
        width - of the export area (in tiles)
        height - of the export area ((in tiles)
    • Method Detail

      • neededInfo

        public int neededInfo()
        return list of needed map up-loads
        Specified by:
        neededInfo in interface Exporter
      • export_width

        public int export_width()
        return the export width (in tiles)
        Specified by:
        export_width in interface Exporter
      • export_height

        public int export_height()
        return the export height (in tiles)
        Specified by:
        export_height in interface Exporter
      • tileSize

        public void tileSize​(int meters)
        Set the size of a single tile
        Specified by:
        tileSize in interface Exporter
        Parameters:
        meters - real-world width of a tile
      • position

        public void position​(double lat,
                             double lon)
        Set the lat/lon of the region being exported
        Specified by:
        position in interface Exporter
        Parameters:
        lat - real world latitude of map center
        lon - real world longitude of map center
      • temps

        public void temps​(double meanTemp,
                          double meanSummer,
                          double meanWinter)
        Set seasonal temperature range for region being exported
        Specified by:
        temps in interface Exporter
        Parameters:
        meanTemp - mean (all year) temperature
        meanSummer - mean (summer) temperature
        meanWinter - mean (winter) temperature
      • heightMap

        public void heightMap​(double[][] heights)
        Up-load the altitude of every tile
        Specified by:
        heightMap in interface Exporter
        Parameters:
        heights - height (in meters) of every point
      • erodeMap

        public void erodeMap​(double[][] erode)
        Up-load the net erosion/deposition for every tile
        Specified by:
        erodeMap in interface Exporter
        Parameters:
        erode - per point height (in meters) of soil lost to erosion negative means sedimentqation
      • rainMap

        public void rainMap​(double[][] rain)
        Up-load the annual rainfall for every tile
        Specified by:
        rainMap in interface Exporter
        Parameters:
        rain - per point depth (in meters) of annual rainfall
      • soilMap

        public void soilMap​(double[][] soil,
                            java.lang.String[] names)
        Up-load the soil type for every tile
        Specified by:
        soilMap in interface Exporter
        Parameters:
        soil - - per point soil type
        names - - per type name strings
      • floraMap

        public void floraMap​(double[][] flora,
                             java.lang.String[] names)
        Up-load the flora type for every tile
        Specified by:
        floraMap in interface Exporter
        Parameters:
        flora - - per point flora type
        names - - per type name strings
      • faunaMap

        public void faunaMap​(double[][] fauna,
                             java.lang.String[] names)
        Up-load the fauna type for every tile
        Specified by:
        faunaMap in interface Exporter
        Parameters:
        fauna - - per point fauna type
        names - - per-type name strings
      • waterMap

        public void waterMap​(double[][] depths)
        Up-load the surface-water-depth for every tile
        Specified by:
        waterMap in interface Exporter
        Parameters:
        depths - - per point depth of water
      • writeFile

        public boolean writeFile​(java.lang.String filename)
        Export the up-loaded information in selected format
        Specified by:
        writeFile in interface Exporter
        Parameters:
        filename - - name of output file
      • preview

        public void preview​(Exporter.WhichMap chosen,
                            java.awt.Color[] colorMap)
        generate a preview of the currently up-loaded export
        Specified by:
        preview in interface Exporter
        Parameters:
        chosen - map type (e.g. height, flora)
        colorMap - - palette to be used in preview