Documentation
¶
Overview ¶
Package wxx defines the major data types for decoding, manipulating, and encoding Worldographer data files. We support Worldographer 2025. Files from the original Worldographer, sometimes called "Worldographer classic," are refused (ErrClassicMap); Worldographer 2025 converts them.
Index ¶
- Constants
- func Version() semver.Version
- type BlurTerrainBG_t
- type Configuration_t
- type Corner_e
- type CurveControl_t
- type Decoder
- type Dotted
- type Encoder
- type Error
- type ExtraTerrainLayer_t
- type ExtraTerrain_t
- type FeatureConfig_t
- type FeatureLocation_t
- type Feature_t
- type GridAndNumbering_t
- type Information_t
- type Informations_t
- type LabelLocation_t
- type LabelStyle_t
- type Label_t
- type MapKey_t
- type MapLayer_t
- type Map_t
- func (m *Map_t) CanonicalVertex(v Vertex_t) (Vertex_t, error)
- func (m *Map_t) Corners() ([6]Corner_e, error)
- func (m *Map_t) GridOrientation() (hexg.LayoutOffset, bool)
- func (m *Map_t) NewEdgePath(vertices []Vertex_t, opts ...PathOption) (*Shape_t, error)
- func (m *Map_t) NewPath(points []Position_t, opts ...PathOption) (*Shape_t, error)
- func (m *Map_t) SameCorner(a, b Vertex_t) (bool, error)
- func (m *Map_t) SharesEdge(a, b Vertex_t) (bool, error)
- func (m *Map_t) TileCenter(col, row int) (Position_t, error)
- func (m *Map_t) TileCorner(col, row int, c Corner_e) (Position_t, error)
- func (m *Map_t) Validate() error
- func (m *Map_t) VertexPosition(v Vertex_t) (Position_t, error)
- type NoteLocation_t
- type Note_t
- type PathOption
- type Point_t
- type Position_t
- type Projection_e
- type RGBA_t
- type Resources_t
- type ShapeConfig_t
- type ShapeStyle_t
- type Shape_t
- type TerrainAndLocation_t
- type TerrainConfig_t
- type TerrainMap_t
- type Terrain_t
- type TextConfig_t
- type TextureConfig_t
- type Tile_t
- type Tiles_t
- type Version_t
- type Vertex_t
Constants ¶
const ( ErrAmbiguousAppCodec = Error("ambiguous application version codec") ErrAttributeSpelledTwice = Error("attribute stated in two spellings") ErrCDATATerminator = Error("text contains the CDATA terminator \"]]>\"") ErrClassicMap = Error("classic (Worldographer 1.x) map: convert it in Worldographer 2025 first") ErrFSError = Error("file-system") ErrGUnZipFailed = Error("gunzip failed") ErrGZipFailed = Error("gzip failed") ErrGZipNewReaderFailed = Error("gzip new reader failed") ErrIncompleteMap = Error("incomplete map") ErrInvalidCodecDeclaration = Error("invalid codec declaration") ErrInvalidDottedComponent = Error("invalid dotted version component") ErrInvalidDottedComponentCount = Error("invalid dotted version component count") ErrInvalidDottedVersion = Error("invalid dotted version") ErrInvalidEncodingHeader = Error("invalid encoding header") ErrInvalidExtraTerrainResource = Error("invalid extra terrain resource") ErrInvalidGZip = Error("invalid gzip") ErrInvalidHexOrientation = Error("invalid hex orientation") ErrInvalidColorAttribute = Error("invalid color attribute") ErrInvalidCorner = Error("invalid hex corner") ErrInvalidIntegerAttribute = Error("invalid integer attribute") ErrInvalidMapMetadata = Error("invalid <map> metadata") ErrInvalidShape = Error("invalid shape") ErrInvalidTerrainMapFieldCount = Error("invalid terrain map field count") ErrInvalidTerrainMap = Error("invalid terrain map") ErrInvalidTileGrid = Error("invalid tile grid") ErrInvalidTileResource = Error("invalid tile resource") 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") ErrNilMap = Error("nil map") ErrNoteKeyMismatch = Error("note key disagrees with its location") ErrNoteWithoutLocation = Error("note without location") 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") ErrUnacceptedAppVersion = Error("unaccepted application version") ErrUnknownMapLayer = Error("unknown map layer") ErrUnknownVersion = Error("unknown version") ErrUnknownXMLHeader = Error("unknown xml header") ErrUnmodeledStubLoss = Error("target cannot express an unmodeled stub") ErrUnparsedDottedVersion = Error("unparsed dotted version") ErrUnsupportedHexOrientation = Error("unsupported hex orientation") ErrUnsupportedMapMetadata = Error("unsupported map metadata") ErrUnsupportedMapVersion = Error("unsupported map version") ErrUnsupportedSchemaVersion = Error("unsupported schema version") ErrUnsupportedVersion = Error("unsupported version") ErrUnsupportedWXMLVersion = Error("unsupported wxml version") )
const ( DefaultPathMapLayer = "Above Terrain" DefaultPathStrokeWidth = 0.05 )
The defaults are the values Worldographer wrote for the lines in the river-lines fixture (issue #154): blue, 0.05 wide, on Above Terrain, the layer above the terrain layers.
const BlankTerrain = "Blank"
BlankTerrain is the terrain Worldographer treats as always available.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlurTerrainBG_t ¶
type BlurTerrainBG_t struct {
Blur bool `json:"blur,omitempty"`
TopBleed float64 `json:"topBleed,omitempty"`
BottomBleed float64 `json:"bottomBleed,omitempty"`
Randomness float64 `json:"randomness,omitempty"`
BlurStart float64 `json:"blurStart,omitempty"`
BlurEnd float64 `json:"blurEnd,omitempty"`
}
BlurTerrainBG models the W2025 top-level <blurTerrainBG> element. It is referenced as a pointer on Map_t so that nil distinguishes "absent from the file" from "present with zero-valued attributes".
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 Corner_e ¶
type Corner_e int
Corner_e names a corner of a hex. Each orientation uses six of the eight names: COLUMNS (flat-top) hexes have e, se, sw, w, nw and ne, and ROWS (pointy-top) hexes have n, ne, se, s, sw and nw. The names are compass directions from the hex's center, with north up the screen, so ne is up and to the right in both orientations, though it is a different point.
func ParseCorner ¶
ParseCorner returns the corner a short name names, as String spells it.
type CurveControl_t ¶
type CurveControl_t struct {
CX1 float64 `json:"cx1"`
CY1 float64 `json:"cy1"`
CX2 float64 `json:"cx2"`
CY2 float64 `json:"cy2"`
}
CurveControl_t is the pair of control points on a <p type="c">. The values are written with a decimal point, as every sample spells them.
type Dotted ¶
type Dotted struct {
Raw string // verbatim, exactly as read or to be written
Major int
Minor int
// contains filtered or unexported fields
}
Dotted is an on-disk dotted version. It is NOT semver: "2.06" != "2.6". Raw is authoritative for output; the components exist to compare.
Worldographer writes these values as zero-padded ordinals (map/@version "2.06", map/@schema "1.06"). A semver round-trip drops the padding and returns "2.6", which is a different string and therefore a different file. Dotted keeps the bytes it was given and parses the components only so that two versions can be ordered.
A Dotted carries its bytes whether or not they were parseable, because a decoder must be able to keep a malformed on-disk version verbatim without failing (see the fallbacks in the codec packages). Such a value has NO components — not zero components, none — and the unexported parsed flag is what makes that distinction real rather than documented. Only the two constructors, ParseDotted and NewDotted, set it, so a composite literal from any other package (wxx.Dotted{Raw: s}, and the zero Dotted with it) is unparsed by construction and cannot claim an ordering it has no data for. Compare and Less report an error rather than answer from components that are absent; see Parsed.
This is issue #38. Before it, a malformed version decoded to {Raw: "garbage", Major: 0, Minor: 0}, which compared EQUAL to "0.0" and LESS than every real version — a silent wrong answer waiting for the first caller to order two versions.
func NewDotted ¶
NewDotted builds a comparable Dotted from components, for a caller that has no string to parse -- a threshold to compare against, a version computed rather than read.
Raw is rendered as "<major>.<minor>", and that rendering is the whole of what this constructor can know: components carry no padding, so NewDotted(2, 6) gives Raw "2.6" and there is NO WAY to reach "2.06" through it. That is not an omission to be fixed with a padding argument. "2.06" and "2.6" are different files (ADR 0004 Decision 1), and a caller who wants the padded one HAS the string it wants -- ParseDotted("2.06") is the constructor for that, and it is the only one, because a Raw supplied alongside components is a second source for the same fact and the two can disagree. That disagreement is the class of bug issue #38 closed; this constructor does not reopen it from the other side.
So: use this to ORDER versions, not to name one. A Dotted from here is a legitimate operand of Compare and Less, and its Raw is a legitimate string to display -- but passing that Raw as an encode target names the unpadded string literally, which for the supported releases is no application version at all and misses the registry cleanly.
It rejects a negative component, wrapping the same sentinels ParseDotted uses for the same fact, so a caller can test one thing whichever constructor it used. There is no upper bound: no dotted component has a meaningful ceiling.
NewDotted(major, minor) and ParseDotted(fmt.Sprintf("%d.%d", major, minor)) produce identical values, flag included. This is the constructor the #38 amendment to ADR 0004 left open, added in the same change on the maintainer's call.
func ParseDotted ¶
ParseDotted parses an on-disk dotted version such as "2.06" or "1.73".
Raw is set to s verbatim, including any zero padding; Major and Minor are parsed only to support comparison. The grammar is deliberately strict: exactly two components separated by a single ".", each one or more ASCII digits. No sign, no whitespace, no third component.
On success the result reports Parsed; on failure it is the zero Dotted, which does not. Parsing a string is the usual way to obtain a comparable Dotted -- the values come off disk -- but see NewDotted for a caller that holds components rather than bytes.
func (Dotted) Compare ¶
Compare orders d against other by Major, then Minor, returning -1, 0, or +1.
Raw is never consulted. "2.06" and "2.6" are different strings but the same ordinal, so they compare equal. That is the point of the type: the components answer "which is newer" and Raw answers "what do we write", and the two must not be confused.
It returns an error, wrapping ErrUnparsedDottedVersion, when either side is not Parsed. There is no ordering to report in that case and the returned int is not one: an unparsed Dotted has no components, so answering from them would be inventing a fact about a file (issue #38). Callers that hold a version straight from a decoder must handle this; callers holding one from ParseDotted or NewDotted cannot reach it.
func (Dotted) Parsed ¶
Parsed reports whether Major and Minor mean anything.
It is false for the zero Dotted and for one a decoder built from a version string that does not fit the dotted grammar. Raw is trustworthy in every case — it is what goes back to disk — but only a Parsed Dotted can be ordered, and only ParseDotted and NewDotted produce one.
func (Dotted) String ¶
String returns the verbatim string this Dotted was parsed from.
It never re-renders from Major and Minor: that would turn "2.06" into "2.6" and corrupt any file written from it. Anything written to disk comes from Raw. It is defined for an unparsed Dotted too — Raw is exactly what such a value exists to carry.
type ExtraTerrainLayer_t ¶
type ExtraTerrainLayer_t struct {
Name string `json:"name"`
Terrain []*TerrainAndLocation_t `json:"terrain,omitempty"`
}
ExtraTerrainLayer_t is one <mapLayer> inside <extraTerrain>. Name refers to one of Map_t.MapLayers by name; nothing checks that it does.
type ExtraTerrain_t ¶
type ExtraTerrain_t struct {
MapLayers []*ExtraTerrainLayer_t `json:"mapLayers,omitempty"`
}
ExtraTerrain_t models the W2025 top-level <extraTerrain> element: terrain placed on a map layer other than a hex's base tile (issue #34). It is a pointer on Map_t so nil distinguishes absent from present-but-empty.
Each hex's base terrain lives in Tiles, one per hex, and carries no layer. Samples suggest that is the terrain's default layer -- "Terrain Land" for land, "Terrain Water" for water -- and that only terrain the user places on another layer is written here. That is inferred from two 2.08 samples, not confirmed. One hex may appear in several layers, and more than once in one layer, so this is a list per layer, not a map keyed by hex.
type FeatureConfig_t ¶
type FeatureConfig_t struct {
InnerText string `json:"innerText,omitempty"`
}
type FeatureLocation_t ¶
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 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 []*Information_t `json:"details,omitempty"`
InnerText string `json:"innerText,omitempty"`
}
Information_t is one lore entry. The eight lore attributes (Rulers through Domains) are pointers because a file may omit any of them and may also state one as "": nil means the file states no such attribute, and a pointer to "" means it states the attribute empty. Worldographer writes both -- an "Information" entry carries none, a "Religion" entry carries domains="" -- and an encoder must reproduce whichever it was given (issue #66).
Details holds the entries nested inside this one, each itself an Information_t, to any depth. Real files nest three deep -- Information > Religion (a pantheon) > Religion (each god) -- and nothing in the format suggests a limit, so the model imposes none (issue #69).
type Informations_t ¶
type Informations_t struct {
Informations []*Information_t `json:"informations,omitempty"`
InnerText string `json:"innerText,omitempty"`
}
type LabelLocation_t ¶
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"`
// W2025 drop-shadow attributes. DropShadowColor is a nullable string that
// preserves the literal "null" spelling (mirrors Shape_t.DsColor).
DropShadowColor string `json:"dropShadowColor,omitempty"`
DropShadowRadius float64 `json:"dropShadowRadius,omitempty"`
DropShadowSpread float64 `json:"dropShadowSpread,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"`
// W2025 drop-shadow attributes. DropShadowColor is a nullable string that
// preserves the literal "null" spelling (mirrors Shape_t.DsColor).
DropShadowColor string `json:"dropShadowColor,omitempty"`
DropShadowRadius float64 `json:"dropShadowRadius,omitempty"`
DropShadowSpread float64 `json:"dropShadowSpread,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 Map_t ¶
type Map_t struct {
MetaData struct {
// AppVersion is this tool's own version -- a genuine semver, and the only
// semver in this struct. The versions the file states are not semver and
// live in Version.
AppVersion semver.Version `json:"appVersion"`
// Version is the file's on-disk version identity: map/@version and
// map/@schema as the two independent axes they are (ADR 0004). It is
// populated by every decoder, and its Schema selects the codec an encode
// dispatches to.
//
// It replaces DataVersion, which held one semver whose Major was a family
// year and whose Minor.Patch meant the application version for classic and
// the schema version for W2025 -- a different axis per family, in one slot,
// keyed by a label no file states (ADR 0004 Decisions 2 and 4).
Version Version_t `json:"version"`
// 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.06)
} `json:"worldographer"`
Created string `json:"created"` // timestamp of this file
} `json:"meta-data"`
// attributes
//
// There is no Release, Version or Schema here, and their absence is load-bearing.
// They held map/@release, map/@version and map/@schema as the SOURCE file stated
// them, which is provenance, and provenance has one home: MetaData.Worldographer
// (issue #45 Decision 9). Carried here as well, they were a second copy of the
// same facts sitting among the fields an encoder reads -- which is how issue #45
// happened, the encoder writing the input file's identity into the output. The
// encoder now derives every identity byte it writes from the application version
// the caller requires and never reads the map for one, so the copy had no reader
// and is gone. A future reader wanting to know what wrote a file asks
// MetaData.Worldographer; a future writer wanting to know what to emit is told,
// and asks nothing.
Type string `json:"type,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"`
HexOrientation string `json:"hexOrientation,omitempty"` // "COLUMNS" or "ROWS"; Validate rejects anything else; GridOrientation derives the hexg layout from it
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"`
HScrollbarPos float64 `json:"hScrollbarPos,omitempty"` // W2025 UI scroll position
VScrollbarPos float64 `json:"vScrollbarPos,omitempty"` // W2025 UI scroll position
// elements
GridAndNumbering *GridAndNumbering_t `json:"gridAndNumbering,omitempty"`
// BlurTerrainBG is a W2025 top-level element; nil means absent from the file.
BlurTerrainBG *BlurTerrainBG_t `json:"blurTerrainBG,omitempty"`
// ExtraTerrain is a W2025 top-level element; nil means absent from the file.
// It holds terrain placed on layers other than the base tile -- see
// ExtraTerrain_t.
ExtraTerrain *ExtraTerrain_t `json:"extraTerrain,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.
func (*Map_t) CanonicalVertex ¶
CanonicalVertex returns the one name CanonicalVertex gives the corner v names, whichever of its three hexes v names it by. For a COLUMNS map that is a hex's e or se corner, and for a ROWS map a hex's s or se corner: every corner of the grid is exactly one hex's e or se (s or se). So two vertices are the same corner when their canonical vertices are equal; SameCorner says so directly. The errors are TileCorner's.
func (*Map_t) Corners ¶
Corners returns the six corners of a hex in m's HexOrientation, clockwise (y down): e, se, sw, w, nw, ne for COLUMNS, and n, ne, se, s, sw, nw for ROWS. The error is ErrInvalidHexOrientation as for TileCenter.
func (*Map_t) GridOrientation ¶
func (m *Map_t) GridOrientation() (hexg.LayoutOffset, bool)
GridOrientation returns the hexg offset layout of m's grid. It is derived from HexOrientation, the only field that holds the orientation, and is never stored: "COLUMNS" is hexg.OddQ and "ROWS" is hexg.OddR. For any other HexOrientation, including the unset "", ok is false and the layout is meaningless; hexg.LayoutOffset has no unset value (its zero is OddR), so a caller must check ok rather than the layout.
Tile_t.Coords follow the same layout: odd-q for COLUMNS and odd-r for ROWS, because Worldographer staggers odd columns down and odd rows right (#80, #130).
func (*Map_t) NewEdgePath ¶
func (m *Map_t) NewEdgePath(vertices []Vertex_t, opts ...PathOption) (*Shape_t, error)
NewEdgePath returns a line along hex edges, through the hex corners vertices, as a Path shape (issue #155). It is NewPath for the grid: each vertex is converted with VertexPosition (see geometry.go), and the shape is written with isSnapVertices="true", as the app writes a line drawn with Snap Points to Grid. Append it to m.Shapes to add it to the map.
Each pair of consecutive vertices must be the two ends of one hex edge (SharesEdge). Anything else, including the same corner twice, is an ErrInvalidShape error that names the pair: getting odd and even columns wrong is the easy mistake on this grid, and without the check it would show up only as a wrong line in Worldographer. One edge is a two-vertex path. Corners of hexes off the map are allowed, so a path can run along the map's edge. A corner that is not one of m's orientation is ErrInvalidCorner.
func (*Map_t) NewPath ¶
func (m *Map_t) NewPath(points []Position_t, opts ...PathOption) (*Shape_t, error)
NewPath returns a line through points, in shape coordinates, as a Path shape carrying what Worldographer writes for a line drawn with the Shapes tab's Line tool and no fill (issue #155). Append it to m.Shapes to add it to the map.
There must be at least two points, each with finite coordinates. The first becomes the move-to (type "m") and the rest line-tos, as the app writes them. A point equal to the one before it is kept: the app writes one where a corner is clicked twice.
NewPath is for lines that are not on the grid; for a line along hex edges, NewEdgePath checks the corners and snaps the line to the grid. A NewPath line is written with isSnapVertices="false".
Every attribute the options do not set has the value Worldographer 2.06, 2.07 and 2.08 all write for such a line, so the shape does not depend on the application version it is written as. The view levels are WORLD.
func (*Map_t) SameCorner ¶
SameCorner reports whether a and b name the same corner of m's grid. The errors are TileCorner's.
func (*Map_t) SharesEdge ¶
SharesEdge reports whether a and b are the two ends of one hex edge: some hex has both as consecutive corners. The same corner twice is not an edge. The errors are TileCorner's.
func (*Map_t) TileCenter ¶
func (m *Map_t) TileCenter(col, row int) (Position_t, error)
TileCenter returns the center of hex (col, row) in shape coordinates, for m's HexOrientation. col and row may be outside the map: a hex just off the map has a center too. The error is ErrInvalidHexOrientation when m's orientation is neither "COLUMNS" nor "ROWS".
func (*Map_t) TileCorner ¶
func (m *Map_t) TileCorner(col, row int, c Corner_e) (Position_t, error)
TileCorner returns corner c of hex (col, row) in shape coordinates, for m's HexOrientation. col and row may be outside the map, so a path can run along the map's edge. The error is ErrInvalidCorner when c is not a corner of m's orientation (e and w are not corners of a ROWS hex, n and s not of a COLUMNS one), and ErrInvalidHexOrientation as for TileCenter.
func (*Map_t) Validate ¶
Validate reports every way m is internally inconsistent (issue #20).
Map_t is a fully-exported struct with no constructor: a caller assembles one field by field, and nothing until now told them when they had assembled something a Worldographer file cannot be. No decoder produces the states checked here -- a decoder that cannot make sense of a file errors instead -- so every one of them is a map a CALLER built, and the write path met them by panicking. All eight nil substructures below were verified to crash at least one codec, and a grid one column shorter than its own @tilesWide header crashed both -- "index out of range [5] with length 5" through classic, "[13] with length 13" through W2025. A panic is not a diagnosis: it names the encoder's line, not the caller's mistake, and it is not recoverable by a caller who is encoding a map they were handed.
It returns ALL of the problems, joined, rather than the first: a half-assembled map usually has several, and a caller fixing them one error at a time is being made to do the work this method exists to do. Each is wrapped in a constant from errors.go, so errors.Is answers "which KIND of malformed" while the message says which field.
WHAT IT DOES NOT CHECK, deliberately:
MetaData.Version. It can still hold a pair no release ever stated -- the classic application version "1.77" alongside the W2025 schema "1.06" -- and that is issue #20's other half, left open on purpose. Checking it means asking what is registered, the registry is xmlio's, and xmlio cannot be imported here (import cycle). Discovery is #46's to design; a hard-coded list of releases here would be a second registry to drift. Nothing reads MetaData.Version on the encode path today (issue #45 deleted the reader), so the pair is unread rather than obeyed.
RowsHigh and ColumnsWide. They are decode-side labels derived from the orientation and the grid dimensions, and no encoder writes them -- neither schema has an attribute for them. Requiring a caller to set a field nothing emits would reject maps that encode perfectly.
Whether a target can express what m carries. That is a question about the target, not about m, and it is answered by the encoder (see xmlio's downgradeLoss).
A nil receiver is a problem in itself and is reported as one rather than panicking, because "the map I was given is nil" is exactly the sort of caller mistake this method exists to name.
func (*Map_t) VertexPosition ¶
func (m *Map_t) VertexPosition(v Vertex_t) (Position_t, error)
VertexPosition returns v's position: TileCorner(v.Col, v.Row, v.Corner).
type NoteLocation_t ¶
type NoteLocation_t struct {
ViewLevel string `json:"viewLevel,omitempty"`
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
}
NoteLocation_t is a note's <location>.
type Note_t ¶
type Note_t struct {
// attributes
OriginalViewLevel string `json:"originalViewLevel,omitempty"`
Filename string `json:"filename,omitempty"`
Parent string `json:"parent,omitempty"`
Color *RGBA_t `json:"color,omitempty"`
IsWorld bool `json:"isWorld,omitempty"`
IsContinent bool `json:"isContinent,omitempty"`
IsKingdom bool `json:"isKingdom,omitempty"`
IsProvince bool `json:"isProvince,omitempty"`
Title string `json:"title,omitempty"`
// notetext CDATA body
NoteText string `json:"notetext,omitempty"`
// Location is the note's position. The W2025 encoder refuses a note
// without one rather than writing it at 0,0.
Location *NoteLocation_t `json:"location,omitempty"`
}
Note_t is a note pinned to a point on the map, in the W2025 spelling that 2.06, 2.07 and 2.08 write (issue #94).
There is no Key field. On disk, @key is "<viewLevel>,<x>,<y>" of the note's <location>: the same position stated twice. The encoder derives @key from Location, so the two cannot disagree in a file this package writes, and a caller who moves a note moves only Location.
type PathOption ¶
type PathOption func(*pathOptions)
PathOption configures NewPath and NewEdgePath.
func WithGMOnly ¶
func WithGMOnly(gmOnly bool) PathOption
WithGMOnly marks the path as shown to the GM only. The default is false.
func WithMapLayer ¶
func WithMapLayer(name string) PathOption
WithMapLayer puts the path on the named layer, which must be one of the map's MapLayers. The default is DefaultPathMapLayer.
func WithStrokeColor ¶
func WithStrokeColor(c RGBA_t) PathOption
WithStrokeColor sets the line's color; each component must be from 0 to 1. The default is opaque blue, RGBA_t{R: 0, G: 0, B: 1, A: 1}.
func WithStrokeWidth ¶
func WithStrokeWidth(width float64) PathOption
WithStrokeWidth sets the line's width, which must be greater than zero. The default is DefaultPathStrokeWidth.
type Point_t ¶
type Point_t struct {
Type string `json:"type,omitempty"`
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
// IntegerXY records that the file spelled both coordinates as integers,
// with no decimal point and no exponent: x="2700" y="150" rather than
// x="2700.0" y="150.0" (issue #94). Worldographer 2.06, 2.07 and 2.08
// spell a tile-border polygon's points this way and a path's with a
// decimal point; the W2025 decoder records which spelling it read, and the
// W2025 encoder writes it back, so a same-version round trip keeps it.
//
// It is a fact about spelling, not about value: the two spellings of 2700
// are the same number. A point whose coordinates are spelled one each way
// decodes with IntegerXY false, and is written back with both decimal.
//
// A caller who sets IntegerXY, or moves such a point, must keep both
// coordinates whole numbers: the W2025 encoder refuses to write a point
// with IntegerXY set and a fractional coordinate rather than round it.
IntegerXY bool `json:"integerXY,omitempty"`
// Control holds a curve point's two Bezier control points, the W2025
// @cx1 @cy1 @cx2 @cy2, and is nil when the point states none (issue #94).
// Worldographer 2.08 writes them on a curved path's type="c" points; the
// W2025 encoder writes all four when Control is set and none when it is
// nil, so a control point at 0,0 is kept.
Control *CurveControl_t `json:"control,omitempty"`
}
Point_t is one <p> vertex of a shape.
Type is the point's @type ("m" on the first point of a path in the samples), and "" when the file states none. The W2025 encoder writes @type only when it is not empty, so a point that stated none is written without one.
type Position_t ¶
Position_t is a point in shape coordinates.
type Resources_t ¶
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"`
// W2025 line rendering attributes (mirrors Shape_t.LineCap/LineJoin).
LineCap string `json:"lineCap,omitempty"`
LineJoin string `json:"lineJoin,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"`
// ExtraLineDistance, ExtraLineLength, ExtraLineWidth and
// ExtraLineSeparation are the W2025 @extraLine* attributes, which 2.06,
// 2.07 and 2.08 write on every shape (issue #94). The W2025 encoder writes
// none of them when all four are zero.
ExtraLineDistance float64 `json:"extraLineDistance,omitempty"`
ExtraLineLength float64 `json:"extraLineLength,omitempty"`
ExtraLineWidth float64 `json:"extraLineWidth,omitempty"`
ExtraLineSeparation float64 `json:"extraLineSeparation,omitempty"`
// FillRule is "" when the file states no @fillRule, and the W2025 encoder
// then writes none.
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 TerrainAndLocation_t ¶
type TerrainAndLocation_t struct {
Terrain string `json:"terrain"`
Elevation float64 `json:"elevation"`
IsIcy bool `json:"isIcy,omitempty"`
IsGMOnly bool `json:"isGMOnly,omitempty"`
Resources Resources_t `json:"resources"`
CustomBackgroundColor *RGBA_t `json:"customBackgroundColor,omitempty"`
X float64 `json:"x"`
Y float64 `json:"y"`
}
TerrainAndLocation_t is one terrain placed on a layer (<terrainAndLocation>).
Terrain is the terrain's NAME (on disk, @name), e.g. "Classic/Flat Beach" -- not the Tiles_t index into TerrainMap that a base tile uses.
X and Y are the on-disk @location: a point in the map's shape coordinates (see geometry.go), not a hex. They are kept as written, because the mapping to a hex is inferred: on the COLUMNS samples the location is the top left of the hex's bounding box, its TileCenter less (150, 150), and that is unconfirmed for ROWS maps or other hex sizes; see #34.
CustomBackgroundColor is the on-disk @bgColor, written by the app when the placement has Override BG set and omitted otherwise (issue #126). nil means the attribute is absent; opaque black is a colour, not nil (#99).
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"`
}
func (*TerrainMap_t) EnsureTerrain ¶
func (tm *TerrainMap_t) EnsureTerrain(name string) int
EnsureTerrain returns the index of the named terrain, adding it at the next free index if the table does not list it (issue #81).
Worldographer lists only the terrains a map uses, so a fully painted map has no "Blank" entry, yet Blank is always available to it. The maintainer's rule is that no wxx operation may lose Blank. An operation that writes a tile with a terrain the table might not list -- resize filling the hexes it adds with Blank -- takes its index from here instead of refusing the map. Worldographer 2.08 opens a map whose table gained an entry this way.
The next free index is one past the highest, so a table numbered 0..n-1 stays contiguous (see #87 for why that matters to the encoders).
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 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"`
}
type Version_t ¶
type Version_t struct {
// App is map/@version, the application build that wrote the file: "2.06"
// for the W2025 baseline. Every supported file states it, so it is a value
// rather than a pointer.
App Dotted
// Schema is map/@schema, the on-disk data format the file conforms to
// ("1.06" for the W2025 baseline).
//
// nil means the map states no schema. Every supported file states one, so
// a decoded map never holds nil; only a map a caller built can. It was the
// classic (Worldographer 1.x) format's identity, which states no @schema
// attribute at all, until issue #103 removed classic support.
Schema *Dotted
}
Version_t is a file's on-disk version identity: the two independent axes a Worldographer file states (ADR 0003) and nothing else.
There is deliberately no family year. "2017" is a project coinage that appears in no classic file, and "2025" is a marketing label that may change while the data format does not; neither is a fact about the format, so neither belongs in a version identity (ADR 0004). The marketing label survives verbatim in MetaData.Worldographer.Release, where it is provenance rather than identity -- a fact about the file that came in. On the way out it is neither: the encoder derives map/@release from the application version it was required to write (issue #45 Decision 5).
Both members are Dotted, never semver: the components exist to compare and Raw is what goes back to disk.
func (Version_t) String ¶
String renders both axes for display: `app 2.06, schema 1.06` for a W2025 file, and `schema none` when Schema is nil.
This is for humans -- a report line, an error message, a template. Nothing written to a file ever comes from here: an encoder emits App.Raw and Schema.Raw individually, into the attributes they came from.
Source Files
¶
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. |
|
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. |
|
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. |
|
Package xmlio implements the XML decoding and encoding pipeline for Worldographer .wxx files and hosts the registry that maps an application version to the encoder that writes it.
|
Package xmlio implements the XML decoding and encoding pipeline for Worldographer .wxx files and hosts the registry that maps an application version to the encoder that writes it. |
|
internal/appver
Package appver models a codec's declaration of the application versions it accepts, verifies that a declaration is valid on its own terms, and verifies that no two codecs claim the same application version.
|
Package appver models a codec's declaration of the application versions it accepts, verifies that a declaration is valid on its own terms, and verifies that no two codecs claim the same application version. |
|
internal/codec
Package codec defines the codec as the DISPATCHER sees one: the emit half of the parse/emit pair for one schema (ADR 0004 Decision 4), plus the declaration it states about itself.
|
Package codec defines the codec as the DISPATCHER sees one: the emit half of the parse/emit pair for one schema (ADR 0004 Decision 4), plus the declaration it states about itself. |