Package worldBuilder

Class RPGMwriter


  • public class RPGMwriter
    extends java.lang.Object
    write out a series of levels-of-tiles as an RPGMaker map
    • Constructor Summary

      Constructors 
      Constructor Description
      RPGMwriter​(java.io.FileWriter outfile)
      crate an RPGMaker map writer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void endList​(java.lang.String end)
      terminate an object or array
      void epilogue()
      terminate the list of tables
      void prologue​(int height, int width, int tileset)
      write out the prologue for a set of tables
      void startList​(java.lang.String name, java.lang.String start)
      write out the start of an object or array
      void typeMap​(int[] map)
      set the level-to-TerrainType map
      void writeAdjustedTable​(int[][] baseTiles, int[][] levels)
      write out one table (numRows x numCols) w/autotile adjustments
      void writeTable​(int[][] tiles, boolean last)
      write out one table (numRows x numCols)
      • Methods inherited from class java.lang.Object

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

      • RPGMwriter

        public RPGMwriter​(java.io.FileWriter outfile)
        crate an RPGMaker map writer
        Parameters:
        outfile - open output file
        rules - tile selection rules to be used
    • Method Detail

      • typeMap

        public void typeMap​(int[] map)
        set the level-to-TerrainType map
        Parameters:
        map - new map
      • prologue

        public void prologue​(int height,
                             int width,
                             int tileset)
                      throws java.io.IOException
        write out the prologue for a set of tables
        Parameters:
        height - (in tiles) of map
        width - (in tiles) of map
        tileset - (number of the tileset to be used in this map)
        Throws:
        java.io.IOException
      • writeTable

        public void writeTable​(int[][] tiles,
                               boolean last)
                        throws java.io.IOException
        write out one table (numRows x numCols)
        Parameters:
        tiles - ... the array to be written out
        last - .... is this the last table to be written
        Throws:
        java.io.IOException
      • writeAdjustedTable

        public void writeAdjustedTable​(int[][] baseTiles,
                                       int[][] levels)
                                throws java.io.IOException
        write out one table (numRows x numCols) w/autotile adjustments
        Parameters:
        baseTiles - ... the array to be written out
        levels - ... array of types for each tile Note: there is no auto-tiling for the last level (6)
        Throws:
        java.io.IOException
      • epilogue

        public void epilogue()
                      throws java.io.IOException
        terminate the list of tables
        Throws:
        java.io.IOException
      • startList

        public void startList​(java.lang.String name,
                              java.lang.String start)
                       throws java.io.IOException
        write out the start of an object or array
        Parameters:
        name - name of List/Aray
        start - starting character
        Throws:
        java.io.IOException
      • endList

        public void endList​(java.lang.String end)
                     throws java.io.IOException
        terminate an object or array
        Parameters:
        end - ending character
        Throws:
        java.io.IOException