Package VASSAL.tools.imports.adc2
Class MapBoard
java.lang.Object
VASSAL.tools.imports.Importer
VASSAL.tools.imports.adc2.MapBoard
The map board itself.
- Author:
- Michael Kiefte
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA layout consisting of squares in a checkerboard pattern (i.e. each square has four neighbours).protected classA layout consisting of squares in which every second column is shifted downward by one half width.protected classA layout consisting of squares in which every second row is shifted to the right by one half-width.protected classMapboard element based on terrain symbol fromSymbolSet.protected classA line from a hex edge to the centre as in the spoke of a wheel.protected classThe edges of a hex or square.protected classHexes aligned along rows.protected classA layout in which every second row is offset by one-half hex or square.protected classHow the hexes or squares are organized on the map board.protected classA drawable line such as a river, border, or road.protected static classLine styles for hex sides and hex lines.protected static enumline patter such as dashed or dotted or solidprotected classSymbol that is placed in every hex.protected classAnything that can be drawn on the map and is associated with a particular hex.protected classprotected classDefines the numbering system for an ADC2 mapboard.protected classPlace name element which includes not only the name itself, but the font and style that it should be drawn with.protected static enumprotected classHexes in columns.protected classA layout in which every second column is offset--either hexes or squares. -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static FontgetDefaultFont(int size, int font) Get a font based on size and font index.protected MapBoard.Layoutprotected MapBoard.LineDefinitiongetLineDefinition(int index) Returns the LineDefinition object corresponding to the given index.booleanDetermine whether the file is valid for the given importer.protected voidThe method that actually loads the file and creates the classes containing information needed for the archive.protected voidAttributes are tertiary symbols, any number of which can be attached to a specific hex.protected voidRead primary and secondary symbol information.protected voidHex lines are like spokes of the hex and are typically used for things like roads or other elements that traverse from hex to hex.protected voidRead in information on hex sheets which define the hex numbering systems.protected voidInformation about hex sides which are used for things like rivers, etc.protected voidInformation about the width, colour and style of hex sides and hex lines is read in.protected voidRead what order to draw the lines in.protected voidRead symbol that is drawn on all hexes.protected voidBlock of flags to indicate which elements are actually displayed.protected voidRead and set the order of the drawn element types.protected voidRead information on hex numbering.protected voidOptional labels that can be added to hexes.protected voidMany maps are actually just scanned images held in a separate file.protected voidThe colour to fill before any elements are drawn.protected voidCrude version information.protected voidwritePlaceNames(GameModule module) Write out place name information as non-stackable pieces which can be searched via the piece inventory.voidCreate the VASSAL module based on the classes created byload.Methods inherited from class VASSAL.tools.imports.Importer
forceExtension, getExtension, getFileName, getLayeredPieceCollection, getMainMap, getUniqueImageFileName, getUniqueImageFileName, importFile, insertComponent, readNullTerminatedString, readNullTerminatedString, readWindowsFileName, stripExtension
-
Constructor Details
-
MapBoard
public MapBoard()
-
-
Method Details
-
getDefaultFont
Get a font based on size and font index. If this font has not already been created, then it will be generated. Can be reused later if the same font was already created.- Parameters:
size- Font size.font- Font index. See MapBoard.java for format.
-
readScannedMapLayoutFile
Many maps are actually just scanned images held in a separate file. The images are often broken up into sections. An extra file describes how the images are pasted together. This function pieces the images together using theGraphics2Dobjectg.- Throws:
IOException
-
readMapBoardOverlaySymbolBlock
Read symbol that is drawn on all hexes.- Throws:
IOException
-
readMapItemDrawFlagBlock
Block of flags to indicate which elements are actually displayed.- Throws:
IOException
-
readAttributeBlock
Attributes are tertiary symbols, any number of which can be attached to a specific hex. Otherwise, they function the same as primary or secondary hex symbols.- Throws:
IOException
-
readHexDataBlock
Read primary and secondary symbol information. Each hex may only have one of each. Additional symbols must be tertiary attributes.- Throws:
IOException
-
readHexLineBlock
Hex lines are like spokes of the hex and are typically used for things like roads or other elements that traverse from hex to hex. The direction of each spoke is encoded as bit flags, and while ADC2 could encode each hex with only one record, modules typically have a separate record for every spoke resulting in data inflation.- Throws:
IOException
-
readHexSideBlock
Information about hex sides which are used for things like rivers, etc. is read in.- Throws:
IOException
-
readLineDefinitionBlock
Information about the width, colour and style of hex sides and hex lines is read in.- Throws:
IOException
-
readLineDrawPriorityBlock
Read what order to draw the lines in.- Throws:
IOException
-
readMapSheetBlock
Read information on hex numbering.- Throws:
IOException
-
readHexNumberingBlock
Read in information on hex sheets which define the hex numbering systems. This represents supplemental information--some map sheet info occurs earlier in the file. Only the coordinates of the top-left corner are read in here.- Throws:
IOException
-
readMapItemDrawingOrderBlock
Read and set the order of the drawn element types.- Throws:
IOException
-
readVersionBlock
Crude version information. Comes near the end of the file! Actually it's just a flag to indicate whether the version is less than 2.08. In version 2.08, the hexes are abutted slightly differently.- Throws:
IOException
-
readTableColorBlock
The colour to fill before any elements are drawn. The fast-scroll flag is also read.- Throws:
IOException
-
readPlaceNameBlock
Optional labels that can be added to hexes. Can also include a symbol that can be added with the label.- Throws:
IOException
-
getLayout
- Returns:
- The Layout object corresponding to this imported map.
-
getLineDefinition
Returns the LineDefinition object corresponding to the given index. -
load
Description copied from class:ImporterThe method that actually loads the file and creates the classes containing information needed for the archive. The archive is written inwriteToArchive.- Overrides:
loadin classImporter- Parameters:
f- The base file to be imported.- Throws:
IOException- oops
-
writeToArchive
Description copied from class:ImporterCreate the VASSAL module based on the classes created byload. This should not be called directly but ratherimportFile.- Specified by:
writeToArchivein classImporter- Throws:
IOException- oops
-
writePlaceNames
Write out place name information as non-stackable pieces which can be searched via the piece inventory.- Parameters:
module- - Game module to write to.
-
isValidImportFile
Description copied from class:ImporterDetermine whether the file is valid for the given importer.- Specified by:
isValidImportFilein classImporter- Parameters:
f- File- Returns:
trueiffis a valid file for this type.- Throws:
IOException- oops
-