store

package
v0.0.0-...-8c1550f Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlanets

func GetPlanets(root string) (map[string]*Planet, error)

func GetShips

func GetShips(root string) (map[string]*Ship, error)

func GetSystems

func GetSystems(root string) (map[int]*System, error)

Types

type Item

type Item struct {
	Code     string `json:"code"`
	Quantity int    `json:"qty"`
}

type Planet

type Planet struct {
	Name               string
	System             *System
	X                  int
	Y                  int
	Z                  int
	Orbit              int
	EconomicEfficiency int
	Inventory          []*Item
	Link               string
	LSN                int
	MiningDifficulty   float64
	Named              bool
	ProductionPenalty  int
}

type PlanetJSON

type PlanetJSON struct {
	X                  int     `json:"x"`
	Y                  int     `json:"y"`
	Z                  int     `json:"z"`
	Orbit              int     `json:"orbit"`
	EconomicEfficiency int     `json:"economic_efficiency"`
	Inventory          []*Item `json:"inventory,omitempty"`
	LSN                int     `json:"lsn"`
	MiningDifficulty   float64 `json:"mining_difficulty"`
	ProductionPenalty  int     `json:"production_penalty,omitempty"`
}

type Ship

type Ship struct {
	Name     string
	Code     string
	FTL      bool
	Location struct {
		X, Y, Z int
		Orbit   int
		Landed  bool
	}
	Age      int
	Capacity int
	Cargo    []*Item
}

type ShipJSON

type ShipJSON struct {
	Code     string  `json:"code"`
	Age      int     `json:"age,omitempty"`
	Capacity int     `json:"capacity,omitempty"`
	Cargo    []*Item `json:"cargo,omitempty"`
	FTL      bool    `json:"ftl,omitempty"`
	Location struct {
		X      int  `json:"x"`
		Y      int  `json:"y"`
		Z      int  `json:"z"`
		Orbit  int  `json:"orbit,omitempty"`
		Landed bool `json:"landed,omitempty"`
	}
}

type Store

type Store struct {
	Planets map[string]*Planet
	Ships   map[string]*Ship
	Systems map[int]*System
	Sorted  struct {
		Systems []*System
	}
}

func New

func New(root string) (*Store, error)

func (*Store) SortedSystems

func (ds *Store) SortedSystems() []*System

type System

type System struct {
	ID      int
	X, Y, Z int
	Link    string
	Planets []*Planet
}

type SystemJSON

type SystemJSON struct {
	X int `json:"x"`
	Y int `json:"y"`
	Z int `json:"Z"`
}

Jump to

Keyboard shortcuts

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