export_map

package
v1.107.0-a9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnKey

func GetConnKey(from_system string, to_system string) string

func GetImages

func GetImages(folder_name string) *utfextract.Shapes

func PrintFormatedConns

func PrintFormatedConns(target_kinds map[JumpConnectionKind]bool) map[string]bool

Types

type ConnectionEdge

type ConnectionEdge struct {
	FirstSystem  *System
	SecondSystem *System

	FromFirstToSecondJumpable bool
	FromSecondToFirstJumpable bool

	// Const is made in values ordered by priority
	// if Alien gate is present, then it is most important
	// after that Jumpgate, then Jumphole, then Unstable, and then Unknown
	Kind JumpConnectionKind
}

func NewConnectionEdge

func NewConnectionEdge(first_system *System, second_system *System) *ConnectionEdge

func (ConnectionEdge) GetPosX

func (c ConnectionEdge) GetPosX() float64

func (ConnectionEdge) GetPosY

func (c ConnectionEdge) GetPosY() float64

func (ConnectionEdge) IsBireDirectional

func (c ConnectionEdge) IsBireDirectional() bool

func (*ConnectionEdge) SetJumpable

func (c *ConnectionEdge) SetJumpable(FromSystemNick string, ToSystemNick string)

func (*ConnectionEdge) SetKind

func (c *ConnectionEdge) SetKind(first map[JumpConnectionKind]bool, second map[JumpConnectionKind]bool)

type Coords2D

type Coords2D struct {
	X *float64
	Y *float64
}

type Export

type Export struct {
	Mapped  *configs_mapped.MappedConfigs
	Systems []*System
	Graph   SystemGraphs
	Shapes  *utfextract.Shapes

	Exp *configs_export.Exporter
}

func NewExport

func NewExport(ctx context.Context) *Export

func (*Export) EnrichSystemWithObjects

func (e *Export) EnrichSystemWithObjects(
	configs *configs_mapped.MappedConfigs,
	system_to_add *System,
	stats *MissingShapes,
)

func (*Export) Export

func (e *Export) Export(ctx context.Context)

func (*Export) ExportSystems

func (e *Export) ExportSystems(configs *configs_mapped.MappedConfigs) []*System

func (*Export) GetInfocardName

func (e *Export) GetInfocardName(ids_name int, nickname string) string

func (*Export) GetJumpConnectionKind

func (e *Export) GetJumpConnectionKind(jh *systems_mapped.Jumphole) JumpConnectionKind

func (*Export) GetSystemConnections

func (e *Export) GetSystemConnections(systems []*System) SystemGraphs

// we have to find only one between each system // and mark if it is // - Two Way Jump Gate (Blue Connection) // - Two way Jump hole (Yellow connection) // - One Way (Purple Connection) // - Two Way Unstable (Orange connection) // - Pink, unidentified

// How to find them? // per system go? and in hashmap... marking data about each system pair ergh?

// We need to mark if the system is reachable from manhattan by any means? to define if it should be filtered

type Glow

type Glow struct {
	Scale      float64
	InnerColor cfg.Vector
	OuterColor cfg.Vector
}

type JumpConnection

type JumpConnection struct {
	Kind    map[JumpConnectionKind]bool
	*System `json:"-" swaggerignore:"true"`
}

type JumpConnectionKind

type JumpConnectionKind int8
const (
	JumpKindUnknown JumpConnectionKind = iota
	JumpKindUnstable
	JumpKindJumphole
	JumpKindJumpgate
	JumpKindAlien
)

func (JumpConnectionKind) ToStr

func (j JumpConnectionKind) ToStr() string

type Jumphole

type Jumphole struct {
	Obj
	GotoSystem     string
	GotoSystemName string
	Kind           JumpConnectionKind
}

type MissingShapes

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

type Obj

type Obj struct {
	Nickname         string
	Name             string
	Pos              cfg.Vector
	ShapeName        string
	VisibleByDefault bool
	Kind             ObjKind

	Star              Star
	PlanetSolarRadius float64
}

type ObjKind

type ObjKind int8
const (
	ObjUnknown ObjKind = iota
	ObjJumphole
	ObjTradelane
	ObjStar
	ObjBase
	ObjPlanet
)

func (ObjKind) ToNick

func (o ObjKind) ToNick() string

type Region

type Region struct {
	Name string `json:"name"`
}

type Star

type Star struct {
	AtmosphereRange int
	StarRadius      float64
	StarGlow        Glow
	StarCenter      Glow
}

type System

type System struct {
	Nickname    string   `json:"nickname"`
	Name        string   `json:"name"`
	Pos         Coords2D `json:"galaxy_pos"`
	NavMapScale float64

	Region Region `json:"region"`

	SystemGraphInfo

	Objs      []*Obj
	Jumpholes []*Jumphole
}

func (System) GetSquareScale

func (s System) GetSquareScale() float64

type SystemGraphInfo

type SystemGraphInfo struct {
	VisibleByDefault bool                       // from manhattan as usual
	LeadsTo          map[string]*JumpConnection // edges to other systems
}

type SystemGraphs

type SystemGraphs struct {
	Systems         map[string]*System         // sparse graph of systems
	ConnectionEdges map[string]*ConnectionEdge // ready for printing. Only single one per each two systems.
}

func (*SystemGraphs) DFS

func (g *SystemGraphs) DFS(startVertex *System)

func (*SystemGraphs) DFSUtil

func (g *SystemGraphs) DFSUtil(vertex *System, visited map[string]bool)

Jump to

Keyboard shortcuts

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