Package worldBuilder

Class LuaWriter


  • public class LuaWriter
    extends java.lang.Object
    Exporter to render a Cartesian map w/JSON descriptions of each point.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  LuaWriter.EntryPoint
      Foundation needs to know the coordinates of the entry and exit points for each city/village.
      class  LuaWriter.MapInfo  
      class  LuaWriter.Position
      Most of the items on the map are defined by (x,y,z) positions
      class  LuaWriter.ResourceInfo
      for reasons I don't understand, it also needs to now a reference position for each resource (even tho the map shows the position)
    • Constructor Summary

      Constructors 
      Constructor Description
      LuaWriter​(java.lang.String dirname)
      create a new Foundation exporter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      write out the closing braces and close the file
      void comment​(java.lang.String text)  
      boolean endDensities()  
      boolean entrypoints​(LuaWriter.EntryPoint[] places)  
      boolean fileHeader​(int min_altitude, int max_altitude, java.lang.String[] resource_maps)
      write out a mod.lua file header
      boolean map​(java.lang.String name, java.lang.String comment, double density, LuaWriter.MapInfo[] maps, boolean last)  
      boolean startDensities()  
      • Methods inherited from class java.lang.Object

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

      • LuaWriter

        public LuaWriter​(java.lang.String dirname)
        create a new Foundation exporter
        Parameters:
        dirname - of directory into which maps should be written
    • Method Detail

      • fileHeader

        public boolean fileHeader​(int min_altitude,
                                  int max_altitude,
                                  java.lang.String[] resource_maps)
        write out a mod.lua file header
        Parameters:
        min_altitude -
        max_altitude -
        resource_maps -
        Returns:
      • comment

        public void comment​(java.lang.String text)
      • close

        public void close()
        write out the closing braces and close the file
      • startDensities

        public boolean startDensities()
      • map

        public boolean map​(java.lang.String name,
                           java.lang.String comment,
                           double density,
                           LuaWriter.MapInfo[] maps,
                           boolean last)
      • endDensities

        public boolean endDensities()