Class ColonizationMapReader


  • public class ColonizationMapReader
    extends java.lang.Object
    Just pass the name of a Colonization map file (with extension ".MP"). The map file starts with a six-byte header. Byte zero encodes the map width, byte two encodes the map height. The function of the other bytes is unknown, their values, however, are fixed. The header is followed by three "layers", each the size of the map. The first "layer" encodes the terrain type. The function of the other layers is unknown. They are filled with zero bytes. It seems that the least significant three bits encode the basic terrain type, the next two bits encode the forest overlay and the special tile types ice, ocean and sea lanes. The three most significant bits encode combinations of the hill, mountain and river overlays. bits 0-2: tile type bit 3 (8): forest bit 4 (16): forest bits 3+4 (24): special, values larger than 26 are not defined bits 5-7: overlays 0: nothing 1: hill 2: minor river 3: hill + minor river (extremely rare) 4: nothing 5: mountain 6: major river 7: mountain + major river (never seen)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] header  
      static int HEIGHT  
      private static byte[] layer1  
      private static char[] tiletypes  
      static int WIDTH  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tiletypes

        private static final char[] tiletypes
      • header

        private static final byte[] header
      • layer1

        private static byte[] layer1
    • Constructor Detail

      • ColonizationMapReader

        public ColonizationMapReader()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception