wxx

package module
v0.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

= WXX

The goal of this package is to provide methods to read and write Worldographer WXX files.

== Worldographer Applications
Inkwell publishes two versions of Worldographer.

The older version has an opening splash with "Worldographer / Hexographer 2."
It was first released in 2017 so we use "H2017" as the code for the XML schema used by this version.

The newer version has an opening splash with just "Worldographer."
Inkwell calls it "Worldographer 2025," so we use "W2025" as the code for the XML schema used by this version.

These codes (H2017 and W2025) help us keep the XML schema versions straight.

We generally call either version "Worldographer."

== Data Format Versioning

The version number in the data is for the application that created the file.
There is no versioning of the data format for H2017 files.

1. map.release is only in W2025 files and identifies the Worldographer application major version.
2. map.version is in both files and identifies the application minor version.
3. map.schema is only in W2025 files and identifies the XML Schema version.


The following table maps values from the XML data to the WXX Package Schema Version.

|===
|Encoding|map.release|map.version|map.schema|WXX Package Schema Version

|UTF-16/BE||1.77||1.0.0
|UTF-16/BE|2025|2.06|1.06|1.6.0
|===

[NOTE]
====
Only the combinations of values listed in the table are supported by this package.
====

== Design Notes

A WXX file contains compressed XML data using a UTF-16 (big-endian) encoding.

When we import the WXX file, we unzip the data, convert to UTF-8, and then unmarshall to our `XML` data type.
This process depends on the data format version.

[WARNING]
====
The design of this package is not fixed; the following comments on the directory structure are out of date.
====

The XML data type is not meant to be used outside of this package, so it is defined in an `internal` folder.
This makes the type very clumsy to use, but makes the intention very clear.

Please read
https://dave.cheney.net/2019/10/06/use-internal-packages-to-reduce-your-public-api-surface[Dave Cheney's article]
for details on the `internal` designation.

== Adapters

I am assuming that we'll use _adapters_ to decode and encode the Worldographer data file.

In general, we'll always decode the Worldographer data file to an internal Map structure.
We'll use an external adapter to convert to the global `Map` structure.

Likewise, we'll use an adapter to convert the global `Map` structure to our internal Map when we need to write data,
and then we'll encode that Map to write the Worldographer data file.

[NOTE]
====
See the `cmd/wxxdemo` for an example of how to use the pipelines.
====

=== Decoding Pipeline

Decoding starts by reading the `.wxx` file into a `[]byte`.
The `gzutf16` package provides a ReadCloser for this.


Our `UTF-16 to UTF-8` adapter verifies that the data starts with a `<?xml version='1.0' encoding='utf-16'?>` header.
If it doesn't, an error is returned.
Otherwise, the header is removed and the remainder of the slice is converted to UTF-8 encoding.

The generic decoder looks for the Worldographer Version near the start of the data.
If it can't find it, an error is returned.
Otherwise, the Worldographer Version is used to determine the XML Data Format.
That determines which version of the decoder is used to unmarshal the data into our `Map` structure.

[NOTE]
====
It is important to note that we only have one version of this `Map`.
====

The `Map` is an exported Go struct and is documented in a separate file.

I imagine that the typical command will read a `.wxx` into a `Map`, manipulate it, then write it back to a `.wxx` file.

=== Encoding Pipeline

The encoding pipeline converts a `Map` structure to a `[]byte` containing the compressed XML data for Worldographer.

You must specify the Worldographer Version to target for the encoding.
That version determines the version of the XML Data Format to create.
The version is also stored in the XML data.

The generic encoder uses the Worldographer Version to pick a suitable encoder.
If it can't find one, an error is returned.
Otherwise, the `Map` data is translated into XML data.

The XML data is marshalled to a `[]byte` using a UTF-8 encoding.
That slice is returned.

Our `UTF-8 to UTF-16` adapter converts the slice to UTF-16 and adds the `<?xml version='1.0' encoding='utf-16'?>` header.
It returns a new `[]byte`.

Our `gzip` adapter compresses the slice and returns a new `[]byte`.

Encoding ends by writing the slice to a file with the `.wxx` extension.
The `gzutf16` package provides a Buffer to help with that and an WriteFile function, too.

Documentation

Overview

Package wxx defines the major data types for decoding, manipulating, and encoding Worldographer data files. We support two versions, Worldographer and Worldographer 2025. The original Worldographer is sometimes called "Worldographer classic." We call them H2017 and H2025 to reduce confusion.

Index

Constants

View Source
const (
	ErrFSError                     = Error("file-system")
	ErrGUnZipFailed                = Error("gunzip failed")
	ErrGZipFailed                  = Error("gzip failed")
	ErrGZipNewReaderFailed         = Error("gzip new reader failed")
	ErrInvalidEncodingHeader       = Error("invalid encoding header")
	ErrInvalidGZip                 = Error("invalid gzip")
	ErrInvalidHexOrientation       = Error("invalid hex orientation")
	ErrInvalidMapMetadata          = Error("invalid <map> metadata")
	ErrInvalidTerrainMapFieldCount = Error("invalid terrain map field count")
	ErrInvalidUTF16                = Error("invalid utf-16")
	ErrInvalidUTF8                 = Error("invalid utf-8")
	ErrInvalidVersion              = Error("invalid version")
	ErrInvalidXML                  = Error("invalid xml")
	ErrInvalidXMLHeader            = Error("invalid xml header")
	ErrMapNotClosed                = Error("<map> not closed")
	ErrMissingBOM                  = Error("missing bom")
	ErrMissingFinalByte            = Error("missing final byte")
	ErrMissingMapElement           = Error("missing map element")
	ErrMissingVersion              = Error("missing version")
	ErrMissingWxxExtension         = Error("missing .wxx extension")
	ErrMissingXMLHeader            = Error("missing xml header")
	ErrNotBigEndianUTF16Encoded    = Error("not big-endian utf-16 encoded")
	ErrNotCompressed               = Error("not compressed")
	ErrNotExists                   = Error("not exists")
	ErrNotFile                     = Error("not a file")
	ErrNotImplemented              = Error("not implemented")
	ErrPipelineHalted              = Error("pipeline halted")
	ErrRawReadFailed               = Error("raw read failed")
	ErrUnknownVersion              = Error("unknown version")
	ErrUnknownXMLHeader            = Error("unknown xml header")
	ErrUnsupportedMapMetadata      = Error("unsupported map metadata")
	ErrUnsupportedMapRelease       = Error("unsupported map release")
	ErrUnsupportedMapSchema        = Error("unsupported map schema")
	ErrUnsupportedMapVersion       = Error("unsupported map version")
	ErrUnsupportedSchemaVersion    = Error("unsupported schema version")
	ErrUnsupportedVersion          = Error("unsupported version")
	ErrUnsupportedWXMLVersion      = Error("unsupported wxml version")
)

Variables

This section is empty.

Functions

func Version

func Version() semver.Version

Types

type Configuration_t

type Configuration_t struct {
	TerrainConfig []*TerrainConfig_t `json:"terrain-config,omitempty"`
	FeatureConfig []*FeatureConfig_t `json:"feature-config,omitempty"`
	TextureConfig []*TextureConfig_t `json:"texture-config,omitempty"`
	TextConfig    *TextConfig_t      `json:"text-config,omitempty"`
	ShapeConfig   *ShapeConfig_t     `json:"shape-config"`
	InnerText     string             `json:"InnerText,omitempty"`
}

type Decoder

type Decoder interface {
	Decode(io.Reader) (*Map_t, error)
}

type Encoder

type Encoder interface {
	Encode(io.Writer, *Map_t) error
}

type Error

type Error string

Error implements constant errors

func (Error) Error

func (e Error) Error() string

Error implements the Errors interface

type FeatureConfig_t

type FeatureConfig_t struct {
	InnerText string `json:"innerText,omitempty"`
}

type FeatureLocation_t

type FeatureLocation_t struct {
	ViewLevel string  `json:"viewLevel,omitempty"`
	X         float64 `json:"x,omitempty"`
	Y         float64 `json:"y,omitempty"`
}

type Feature_t

type Feature_t struct {
	Type              string  `json:"type,omitempty"`
	Rotate            float64 `json:"rotate,omitempty"`
	Uuid              string  `json:"uuid,omitempty"`
	MapLayer          string  `json:"mapLayer,omitempty"`
	IsFlipHorizontal  bool    `json:"isFlipHorizontal,omitempty"`
	IsFlipVertical    bool    `json:"isFlipVertical,omitempty"`
	Scale             float64 `json:"scale,omitempty"`
	ScaleHt           float64 `json:"scaleHt,omitempty"`
	Tags              string  `json:"tags,omitempty"`
	Color             *RGBA_t `json:"color,omitempty"`
	RingColor         *RGBA_t `json:"ringcolor,omitempty"`
	IsGMOnly          bool    `json:"isGMOnly,omitempty"`
	IsPlaceFreely     bool    `json:"isPlaceFreely,omitempty"`
	LabelPosition     string  `json:"labelPosition,omitempty"`
	LabelDistance     int     `json:"labelDistance,omitempty"`
	IsWorld           bool    `json:"isWorld,omitempty"`
	IsContinent       bool    `json:"isContinent,omitempty"`
	IsKingdom         bool    `json:"isKingdom,omitempty"`
	IsProvince        bool    `json:"isProvince,omitempty"`
	IsFillHexBottom   bool    `json:"isFillHexBottom,omitempty"`
	IsHideTerrainIcon bool    `json:"isHideTerrainIcon,omitempty"`

	Location *FeatureLocation_t `json:"location,omitempty"`
	Label    *Label_t           `json:"label,omitempty"`
}

type GridAndNumbering_t

type GridAndNumbering_t struct {
	Color0                      string  `json:"color0,omitempty"` // hex - "0x00000040"
	Color1                      string  `json:"color1,omitempty"` // hex - "0x00000040"
	Color2                      string  `json:"color2,omitempty"` // hex - "0x00000040"
	Color3                      string  `json:"color3,omitempty"` // hex - "0x00000040"
	Color4                      string  `json:"color4,omitempty"` // hex - "0x00000040"
	Width0                      float64 `json:"width0,omitempty"`
	Width1                      float64 `json:"width1,omitempty"`
	Width2                      float64 `json:"width2,omitempty"`
	Width3                      float64 `json:"width3,omitempty"`
	Width4                      float64 `json:"width4,omitempty"`
	GridOffsetContinentKingdomX float64 `json:"gridOffsetContinentKingdomX,omitempty"`
	GridOffsetContinentKingdomY float64 `json:"gridOffsetContinentKingdomY,omitempty"`
	GridOffsetWorldContinentX   float64 `json:"gridOffsetWorldContinentX,omitempty"`
	GridOffsetWorldContinentY   float64 `json:"gridOffsetWorldContinentY,omitempty"`
	GridOffsetWorldKingdomX     float64 `json:"gridOffsetWorldKingdomX,omitempty"`
	GridOffsetWorldKingdomY     float64 `json:"gridOffsetWorldKingdomY,omitempty"`
	GridSquare                  int     `json:"gridSquare,omitempty"`
	GridSquareHeight            float64 `json:"gridSquareHeight,omitempty"` // "-1.0" is special?
	GridSquareWidth             float64 `json:"gridSquareWidth,omitempty"`  // "-1.0" is special?
	GridOffsetX                 float64 `json:"gridOffsetX,omitempty"`
	GridOffsetY                 float64 `json:"gridOffsetY,omitempty"`
	NumberFont                  string  `json:"numberFont,omitempty"`
	NumberColor                 string  `json:"numberColor,omitempty"` // hex - "0x000000ff"
	NumberSize                  int     `json:"numberSize,omitempty"`
	NumberStyle                 string  `json:"numberStyle,omitempty"`     // "PLAIN" or ??
	NumberFirstCol              int     `json:"numberFirstCol,omitempty"`  // "0"
	NumberFirstRow              int     `json:"numberFirstRow,omitempty"`  // "0"
	NumberOrder                 string  `json:"numberOrder,omitempty"`     // "COL_ROW" or ??
	NumberPosition              string  `json:"numberPosition,omitempty"`  // "BOTTOM" or ??
	NumberPrePad                string  `json:"numberPrePad,omitempty"`    // "DOUBLE_ZERO" or ??
	NumberSeparator             string  `json:"numberSeparator,omitempty"` // "." or free text?
}

type InformationDetail_t

type InformationDetail_t struct {
	Uuid         string `json:"uuid,omitempty"`
	Type         string `json:"type,omitempty"`
	Title        string `json:"title,omitempty"`
	Rulers       string `json:"rulers,omitempty"`
	Government   string `json:"government,omitempty"`
	Cultures     string `json:"cultures,omitempty"`
	Language     string `json:"language,omitempty"`
	ReligionType string `json:"religionType,omitempty"`
	Culture      string `json:"culture,omitempty"`
	HolySymbol   string `json:"holySymbol,omitempty"`
	Domains      string `json:"domains,omitempty"`

	InnerText string `json:"innerText,omitempty"`
}

type Information_t

type Information_t struct {
	Uuid         string `json:"uuid,omitempty"`
	Type         string `json:"type,omitempty"`
	Title        string `json:"title,omitempty"`
	Rulers       string `json:"rulers,omitempty"`
	Government   string `json:"government,omitempty"`
	Cultures     string `json:"cultures,omitempty"`
	Language     string `json:"language,omitempty"`
	ReligionType string `json:"religionType,omitempty"`
	Culture      string `json:"culture,omitempty"`
	HolySymbol   string `json:"holySymbol,omitempty"`
	Domains      string `json:"domains,omitempty"`

	Details   []*InformationDetail_t `json:"details,omitempty"`
	InnerText string                 `json:"innerText,omitempty"`
}

type Informations_t

type Informations_t struct {
	Informations []*Information_t `json:"informations,omitempty"`
	InnerText    string           `json:"innerText,omitempty"`
}

type LabelLocation_t

type LabelLocation_t struct {
	ViewLevel string  `json:"viewLevel,omitempty"`
	X         float64 `json:"x,omitempty"`
	Y         float64 `json:"y,omitempty"`
	Scale     float64 `json:"scale,omitempty"`
}

type LabelStyle_t

type LabelStyle_t struct {
	Name            string  `json:"name,omitempty"`
	FontFace        string  `json:"fontFace,omitempty"`
	Scale           float64 `json:"scale,omitempty"`
	IsBold          bool    `json:"isBold,omitempty"`
	IsItalic        bool    `json:"isItalic,omitempty"`
	Color           *RGBA_t `json:"color,omitempty"`
	BackgroundColor *RGBA_t `json:"backgroundColor,omitempty"`
	OutlineSize     float64 `json:"outlineSize,omitempty"`
	OutlineColor    *RGBA_t `json:"outlineColor,omitempty"`
}

type Label_t

type Label_t struct {
	MapLayer        string  `json:"mapLayer,omitempty"`
	Style           string  `json:"style,omitempty"`
	FontFace        string  `json:"fontFace,omitempty"`
	Color           *RGBA_t `json:"color,omitempty"`
	OutlineColor    *RGBA_t `json:"outlineColor,omitempty"`
	OutlineSize     float64 `json:"outlineSize,omitempty"`
	Rotate          float64 `json:"rotate,omitempty"`
	IsBold          bool    `json:"isBold,omitempty"`
	IsItalic        bool    `json:"isItalic,omitempty"`
	IsWorld         bool    `json:"isWorld,omitempty"`
	IsContinent     bool    `json:"isContinent,omitempty"`
	IsKingdom       bool    `json:"isKingdom,omitempty"`
	IsProvince      bool    `json:"isProvince,omitempty"`
	IsGMOnly        bool    `json:"isGMOnly,omitempty"`
	Tags            string  `json:"tags,omitempty"`
	BackgroundColor *RGBA_t `json:"backgroundColor,omitempty"`

	Location  *LabelLocation_t `json:"location,omitempty"`
	InnerText string           `json:"innerText,omitempty"`
}

type MapKey_t

type MapKey_t struct {
	// attributes
	PositionX         float64 `json:"positionx,omitempty"`
	PositionY         float64 `json:"positiony,omitempty"`
	Viewlevel         string  `json:"viewlevel,omitempty"` // "null", "WORLD"
	Height            float64 `json:"height,omitempty"`
	BackgroundColor   *RGBA_t `json:"backgroundcolor,omitempty"`
	BackgroundOpacity float64 `json:"backgroundopacity,omitempty"`
	TitleText         string  `json:"titleText,omitempty"`
	TitleFontFace     string  `json:"titleFontFace,omitempty"`
	TitleFontColor    *RGBA_t `json:"titleFontColor,omitempty"`
	TitleFontBold     bool    `json:"titleFontBold,omitempty"`
	TitleFontItalic   bool    `json:"titleFontItalic,omitempty"`
	TitleScale        float64 `json:"titleScale,omitempty"`
	ScaleText         string  `json:"scaleText,omitempty"`
	ScaleFontFace     string  `json:"scaleFontFace,omitempty"`
	ScaleFontColor    *RGBA_t `json:"scaleFontColor,omitempty"`
	ScaleFontBold     bool    `json:"scaleFontBold,omitempty"`
	ScaleFontItalic   bool    `json:"scaleFontItalic,omitempty"`
	ScaleScale        float64 `json:"scaleScale,omitempty"`
	EntryFontFace     string  `json:"entryFontFace,omitempty"`
	EntryFontColor    *RGBA_t `json:"entryFontColor,omitempty"`
	EntryFontBold     bool    `json:"entryFontBold,omitempty"`
	EntryFontItalic   bool    `json:"entryFontItalic,omitempty"`
	EntryScale        float64 `json:"entryScale,omitempty"`
}

type MapLayer_t

type MapLayer_t struct {
	Name      string `json:"name"`
	IsVisible bool   `json:"isVisible"`
}

type Map_t

type Map_t struct {
	MetaData struct {
		AppVersion  semver.Version `json:"appVersion"`  // version of this application
		DataVersion semver.Version `json:"dataVersion"` // version of the data in the file
		// Worldographer defines the metadata for the WXX file
		Worldographer struct {
			Name    string    `json:"name"`    // name of input
			Created time.Time `json:"created"` // timestamp of input
			Release string    `json:"release"` // Worldographer release (e.g., 2025)
			Version string    `json:"version"` // Worldographer/Hexographer version (e.g. 2.06)
			Schema  string    `json:"schema"`  // Worldographer XML Schema version (e.g. 1.10)
		} `json:"worldographer"`
		Created string `json:"created"` // timestamp of this file
	} `json:"meta-data"`

	// attributes
	Type                      string             `json:"type,omitempty"`
	Release                   string             `json:"release,omitempty"`
	Version                   string             `json:"version,omitempty"`
	Schema                    string             `json:"schema,omitempty"`
	LastViewLevel             string             `json:"lastViewLevel,omitempty"`
	ContinentFactor           int                `json:"continentFactor,omitempty"`
	KingdomFactor             int                `json:"kingdomFactor,omitempty"`
	ProvinceFactor            int                `json:"provinceFactor,omitempty"`
	WorldToContinentHOffset   float64            `json:"worldToContinentHOffset,omitempty"`
	ContinentToKingdomHOffset float64            `json:"continentToKingdomHOffset,omitempty"`
	KingdomToProvinceHOffset  float64            `json:"kingdomToProvinceHOffset,omitempty"`
	WorldToContinentVOffset   float64            `json:"worldToContinentVOffset,omitempty"`
	ContinentToKingdomVOffset float64            `json:"continentToKingdomVOffset,omitempty"`
	KingdomToProvinceVOffset  float64            `json:"kingdomToProvinceVOffset,omitempty"`
	HexWidth                  float64            `json:"hexWidth,omitempty"`
	HexHeight                 float64            `json:"hexHeight,omitempty"`
	GridOrientation           hexg.Orientation_e `json:"gridOrientation,omitempty"` // orientation for hexg package
	HexOrientation            string             `json:"hexOrientation,omitempty"`  // "COLUMNS" or ??
	RowsHigh                  int                `json:"rowsHigh,omitempty"`        // number of rows (derived from TilesHigh based on orientation)
	ColumnsWide               int                `json:"columnsWide,omitempty"`     // number of columns (derived from TilesWide based on orientation)
	MapProjection             Projection_e       `json:"mapProjection,omitempty"`
	ShowNotes                 bool               `json:"showNotes,omitempty"`
	ShowGMOnly                bool               `json:"showGMOnly,omitempty"`
	ShowGMOnlyGlow            bool               `json:"showGMOnlyGlow,omitempty"`
	ShowFeatureLabels         bool               `json:"showFeatureLabels,omitempty"`
	ShowGrid                  bool               `json:"showGrid,omitempty"`
	ShowGridNumbers           bool               `json:"showGridNumbers,omitempty"`
	ShowShadows               bool               `json:"showShadows,omitempty"`
	TriangleSize              int                `json:"triangleSize,omitempty"`

	// elements
	GridAndNumbering *GridAndNumbering_t `json:"gridAndNumbering,omitempty"`

	// TerrainMap assigns numbers to each terrain type.
	// The terrain type is used in the TileRow struct.
	TerrainMap *TerrainMap_t `json:"terrainMap,omitempty"`

	// MapLayers assigns a boolean "isVisible" to each layer.
	MapLayers []*MapLayer_t `json:"mapLayers,omitempty"`

	Tiles *Tiles_t `json:"tiles,omitempty"`

	MapKey *MapKey_t `json:"mapKey,omitempty"`

	Features []*Feature_t `json:"features,omitempty"`

	Labels []*Label_t `json:"labels,omitempty"`

	Shapes []*Shape_t `json:"shapes,omitempty"`

	Notes []*Note_t `json:"notes,omitempty"`

	Informations *Informations_t `json:"informations"`

	Configuration *Configuration_t `json:"configuration"`
}

Map_t is the in-memory representation of the map data. We have created this to work with the known versions of Worldographer XML data. We are assuming that this will continue to work with future versions of the application.

type Note_t

type Note_t struct {
	InnerText string `json:"innerText,omitempty"`
}

type Point_t

type Point_t struct {
	Type string  `json:"type,omitempty"`
	X    float64 `json:"x,omitempty"`
	Y    float64 `json:"y,omitempty"`
}

type Projection_e

type Projection_e int
const (
	FLAT Projection_e
	ICOSAHEDRAL
)

type RGBA_t

type RGBA_t struct {
	R float64
	G float64
	B float64
	A float64
}

type Resources_t

type Resources_t struct {
	Animal int
	Brick  int
	Crops  int
	Gems   int
	Lumber int
	Metals int
	Rock   int
}

type ShapeConfig_t

type ShapeConfig_t struct {
	ShapeStyles []*ShapeStyle_t `json:"shapeStyles,omitempty"`
	InnerText   string          `json:"innerText,omitempty"`
}

type ShapeStyle_t

type ShapeStyle_t struct {
	Name          string  `json:"name,omitempty"`
	StrokeType    string  `json:"strokeType,omitempty"`
	IsFractal     bool    `json:"isFractal,omitempty"`
	StrokeWidth   float64 `json:"strokeWidth,omitempty"`
	Opacity       float64 `json:"opacity,omitempty"`
	SnapVertices  bool    `json:"snapVertices,omitempty"`
	Tags          string  `json:"tags,omitempty"`
	DropShadow    bool    `json:"dropShadow,omitempty"`
	InnerShadow   bool    `json:"innerShadow,omitempty"`
	BoxBlur       bool    `json:"boxBlur,omitempty"`
	DsSpread      float64 `json:"dsSpread,omitempty"`
	DsRadius      float64 `json:"dsRadius,omitempty"`
	DsOffsetX     float64 `json:"dsOffsetX,omitempty"`
	DsOffsetY     float64 `json:"dsOffsetY,omitempty"`
	InsChoke      float64 `json:"insChoke,omitempty"`
	InsRadius     float64 `json:"insRadius,omitempty"`
	InsOffsetX    float64 `json:"insOffsetX,omitempty"`
	InsOffsetY    float64 `json:"insOffsetY,omitempty"`
	BbWidth       float64 `json:"bbWidth,omitempty"`
	BbHeight      float64 `json:"bbHeight,omitempty"`
	BbIterations  int     `json:"bbIterations,omitempty"`
	FillTexture   string  `json:"fillTexture,omitempty"`
	StrokeTexture string  `json:"strokeTexture,omitempty"`
	StrokePaint   *RGBA_t `json:"strokePaint,omitempty"`
	FillPaint     *RGBA_t `json:"fillPaint,omitempty"`
	DsColor       *RGBA_t `json:"dscolor,omitempty"`
	InsColor      *RGBA_t `json:"insColor,omitempty"`
}

type Shape_t

type Shape_t struct {
	// attributes0
	BbHeight              float64 `json:"bbHeight,omitempty"`
	BbIterations          int     `json:"bbIterations,omitempty"`
	BbWidth               float64 `json:"bbWidth,omitempty"`
	CreationType          string  `json:"creationType,omitempty"`
	CurrentShapeViewLevel string  `json:"currentShapeViewLevel,omitempty"`
	DsColor               string  `json:"dsColor,omitempty"`
	DsOffsetX             float64 `json:"dsOffsetX,omitempty"`
	DsOffsetY             float64 `json:"dsOffsetY,omitempty"`
	DsRadius              float64 `json:"dsRadius,omitempty"`
	DsSpread              float64 `json:"dsSpread,omitempty"`
	FillRule              string  `json:"fillRule,omitempty"`
	FillTexture           string  `json:"fillTexture,omitempty"`
	HighestViewLevel      string  `json:"highestViewLevel,omitempty"`
	InsChoke              float64 `json:"insChoke,omitempty"`
	InsColor              string  `json:"insColor,omitempty"`
	InsOffsetX            float64 `json:"insOffsetX,omitempty"`
	InsOffsetY            float64 `json:"insOffsetY,omitempty"`
	InsRadius             float64 `json:"insRadius,omitempty"`
	IsBoxBlur             bool    `json:"isBoxBlur,omitempty"`
	IsContinent           bool    `json:"isContinent,omitempty"`
	IsCurve               bool    `json:"isCurve,omitempty"`
	IsDropShadow          bool    `json:"isDropShadow,omitempty"`
	IsGMOnly              bool    `json:"isGMOnly,omitempty"`
	IsInnerShadow         bool    `json:"isInnerShadow,omitempty"`
	IsKingdom             bool    `json:"isKingdom,omitempty"`
	IsMatchTileBorders    bool    `json:"isMatchTileBorders,omitempty"`
	IsProvince            bool    `json:"isProvince,omitempty"`
	IsSnapVertices        bool    `json:"isSnapVertices,omitempty"`
	IsWorld               bool    `json:"isWorld,omitempty"`
	LineCap               string  `json:"lineCap,omitempty"`
	LineJoin              string  `json:"lineJoin,omitempty"`
	MapLayer              string  `json:"mapLayer,omitempty"`
	Opacity               float64 `json:"opacity,omitempty"`
	StrokeColor           string  `json:"strokeColor,omitempty"`
	StrokeTexture         string  `json:"strokeTexture,omitempty"`
	StrokeType            string  `json:"strokeType,omitempty"`
	StrokeWidth           float64 `json:"strokeWidth,omitempty"`
	Tags                  string  `json:"tags,omitempty"`
	Type                  string  `json:"type,omitempty"`

	Points []*Point_t `json:"points,omitempty"`
}

type TerrainConfig_t

type TerrainConfig_t struct {
	InnerText string `json:"innerText,omitempty"`
}

type TerrainMap_t

type TerrainMap_t struct {
	Data map[string]int `json:"data,omitempty"`
	List []*Terrain_t   `json:"list,omitempty"`
}

type Terrain_t

type Terrain_t struct {
	Index int    `json:"index"`
	Label string `json:"label"`
}

type TextConfig_t

type TextConfig_t struct {
	LabelStyles []*LabelStyle_t `json:"labelStyles,omitempty"`
	InnerText   string          `json:"innerText,omitempty"`
}

type TextureConfig_t

type TextureConfig_t struct {
	InnerText string `json:"innerText,omitempty"`
}

type Tile_t

type Tile_t struct {
	Coords                hexg.CubeCoord
	Row                   int
	Column                int
	Terrain               int // lookup into TerrainMap
	Elevation             float64
	IsIcy                 bool
	IsGMOnly              bool
	Resources             Resources_t
	CustomBackgroundColor *RGBA_t
}

type Tiles_t

type Tiles_t struct {
	ViewLevel string `json:"viewLevel,omitempty"`
	TilesWide int    `json:"tilesWide,omitempty"` // number of columns of tiles (x)
	TilesHigh int    `json:"tilesHigh,omitempty"` // number of rows of tiles    (y)

	// Tiles is a two-dimensional array that is indexed by [col][row]
	Tiles [][]*Tile_t `json:"tiles,omitempty"`
}

Directories

Path Synopsis
cmd
bounds command
Package main implements a tool to read a Worldographer file and print the orientation, height, and width.
Package main implements a tool to read a Worldographer file and print the orientation, height, and width.
copy command
Package copy implements a command to copy a Worldographer file by reading the XML from the input and writing it out the new file.
Package copy implements a command to copy a Worldographer file by reading the XML from the input and writing it out the new file.
crop command
Package crop implements a command to crop a Worldographer file by reading the XML from the input and writing it out the new file.
Package crop implements a command to crop a Worldographer file by reading the XML from the input and writing it out the new file.
import command
Package main implements a command to import worldographer terrain layers.
Package main implements a command to import worldographer terrain layers.
info command
Package main implements a command line tool that shows information on WXX data files.
Package main implements a command line tool that shows information on WXX data files.
merge command
Package main implements a simple merge command.
Package main implements a simple merge command.
resize command
Package resize implements a command to resize a Worldographer map
Package resize implements a command to resize a Worldographer map
schema command
Package main implements a command line tool for dumping an XML schema.
Package main implements a command line tool for dumping an XML schema.
server command
Package main implements a web server that displays information about Worldographer files.
Package main implements a web server that displays information about Worldographer files.
version command
Package main implements a command to display the WXX package version.
Package main implements a command to display the WXX package version.
wxx command
Package main implements the `wxx` command line tool.
Package main implements the `wxx` command line tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL