maps

package
v0.0.0-...-4e17882 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TILEOFFSET = -1 // odd rows
	TILESIZE   = 44.0
	TILESIZEX  = TILESIZE
	TILESIZEY  = TILESIZE
	TILEWIDTH  = 2 * TILESIZE
)

Variables

View Source
var (
	TILEHEIGHT = math.Sqrt(3) * TILESIZE
)

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Code rune
}

type Gate

type Gate struct {
	Dest int // gates from here
	Key  int
	Num  int // gates from here
}

type Orientation

type Orientation struct {
	// contains filtered or unexported fields
}

Orientation stores the forward matrix (the fN variables) and backward matrix (the bN variables), plus the start angle. The start angle determines if we have a "flat top" (which is 0°) or "pointy top" (which is 60°) hex.

type Road

type Road struct {
	Id     int
	Name   string
	ToLoc  int
	Hidden bool
}

type Tile

type Tile struct {
	Row, Col int // map tile we're inside

	City             int
	Depth            int
	Gates            []*Gate
	Inside           int
	Mark             int
	Name             string
	Region           string
	Roads            []*Road
	SaveChar         rune
	SummerbridgeFlag int
	Subs             []int
	UldimFlag        int
	Is               struct {
		Hidden         bool
		MajorCity      bool
		RegionBoundary bool
		SafeHaven      bool
		SeaLane        bool
		Water          bool
	}

	Color   enums.Color // map coloring for output
	Terrain enums.Terrain
}

type Tiles

type Tiles map[string]*Tile

func Read

func Read(name string) (Tiles, error)

func (Tiles) ToPNG

func (tiles Tiles) ToPNG(name string) error

func (Tiles) ToSvg

func (tiles Tiles) ToSvg(hexes, mono bool) *svg

Jump to

Keyboard shortcuts

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