sgmrender

package
v0.0.0-...-ae9a0ba Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCountryBorderColor = "#202020"
	DefaultCountryFillColor   = "#c0c0c0"
)

Functions

This section is empty.

Types

type Path

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

func NewPath

func NewPath() Path

func NewVectorPath

func NewVectorPath(vec sgmmath.Vector) Path

func (Path) Complete

func (p Path) Complete() Path

func (Path) CurveDiff

func (p Path) CurveDiff(points []sgmmath.Point, dx, dy float64) Path

func (Path) HorLine

func (p Path) HorLine(x float64) Path

func (Path) LineTo

func (p Path) LineTo(x, y float64) Path

func (Path) LineToPoint

func (p Path) LineToPoint(point sgmmath.Point) Path

func (Path) MoveTo

func (p Path) MoveTo(x, y float64) Path

func (Path) MoveToPoint

func (p Path) MoveToPoint(point sgmmath.Point) Path

func (*Path) String

func (p *Path) String() string

func (*Path) Translate

func (p *Path) Translate(point sgmmath.Point)

func (Path) VertLine

func (p Path) VertLine(y float64) Path

type PathElement

type PathElement struct {
	Command rune
	sgmmath.Point

	Points []sgmmath.Point
}

type RenderOptions

type RenderOptions struct {
	NoGrid               bool `json:"no_grid"`
	NoInsignificantStars bool `json:"no_insignificant_stars"`
	NoStarSystems        bool `json:"no_star_systems"`
	NoHyperLanes         bool `json:"no_hyperlanes"`
	NoFleets             bool `json:"no_fleets"`

	ShowSectors bool `json:"show_sectors"`
}

type Renderer

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

func NewRenderer

func NewRenderer(state *sgm.GameState, opts RenderOptions) *Renderer

func (*Renderer) Render

func (r *Renderer) Render()

func (*Renderer) Write

func (r *Renderer) Write(outPath string) error

func (*Renderer) WriteToBytes

func (r *Renderer) WriteToBytes() ([]byte, error)

type StarAdjacency

type StarAdjacency struct {
	AdjStarId sgm.StarId
	AdjStar   *sgm.Star
	Vector    sgmmath.PolarVector
}

type StarAdjacencyList

type StarAdjacencyList []StarAdjacency

func (StarAdjacencyList) Len

func (l StarAdjacencyList) Len() int

func (StarAdjacencyList) Less

func (l StarAdjacencyList) Less(i, j int) bool

func (StarAdjacencyList) Swap

func (l StarAdjacencyList) Swap(i, j int)

type StarGeoIndex

type StarGeoIndex map[sgm.StarId]StarAdjacencyList

type Style

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

func NewStyle

func NewStyle(opts ...StyleOption) Style

func (Style) String

func (s Style) String() string

func (Style) With

func (s Style) With(opts ...StyleOption) Style

type StyleOption

type StyleOption struct {
	Property string
	Value    string
}

Jump to

Keyboard shortcuts

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