s10state

package module
v1.0.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

s10s-state

Release

export TAG=v1.0.x
git tag $TAG
git push && git push origin $TAG
GOPROXY=proxy.golang.org go list -m github.com/ruudiRatlos/s10s-state@$TAG

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteItem

type RouteItem struct {
	From, To *api.Waypoint
	Dist     int
	Duration time.Duration
	FM       api.ShipNavFlightMode
	Refuel   bool
	Fuel     int
	Left     int
}

type State

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

func NewState

func NewState(l *slog.Logger, c *s10s.Client, dbPath string) *State

func (*State) Agent

func (s *State) Agent() *api.Agent

func (*State) AllAgents

func (s *State) AllAgents(ctx context.Context) (<-chan *api.Agent, int, error)

func (*State) AllAgentsStatic

func (s *State) AllAgentsStatic(ctx context.Context) (<-chan *api.Agent, int, error)

func (*State) AllConstructions

func (s *State) AllConstructions(ctx context.Context, sys s10s.SystemSymbol) ([]*api.Construction, error)

func (*State) AllConstructionsStatic

func (s *State) AllConstructionsStatic(systemSymbol string) ([]*api.Construction, error)

func (*State) AllJumpGates

func (s *State) AllJumpGates(ctx context.Context, sys s10s.SystemSymbol, incUnderConstruction bool) ([]*api.JumpGate, error)

AllJumpGates returns the /jump-gate info for all jumpGates in the system Uncharted JumpGates are NOT returned

func (*State) AllJumpGatesStatic

func (s *State) AllJumpGatesStatic(ctx context.Context, sys s10s.SystemSymbol, incUnderConstruction bool) ([]*api.JumpGate, error)

AllJumpGatesStatic returns the /jump-gate info for all jumpGates currently on disk Uncharted JumpGates are NOT returned

func (*State) AllMarkets

func (s *State) AllMarkets(ctx context.Context, systemSymbol s10s.SystemSymbol) ([]*api.Market, error)

func (*State) AllMarketsStatic

func (s *State) AllMarketsStatic(ctx context.Context, systemSymbol s10s.SystemSymbol) ([]*api.Market, error)

func (*State) AllShipyards

func (s *State) AllShipyards(ctx context.Context, sys s10s.SystemSymbol) ([]*api.Shipyard, error)

func (*State) AllShipyardsStatic

func (s *State) AllShipyardsStatic(ctx context.Context, sys s10s.SystemSymbol) ([]*api.Shipyard, error)

func (*State) AllSystemsStatic

func (state *State) AllSystemsStatic(ctx context.Context) (<-chan *api.System, error)

AllSystemsStatic returns a channel with all systems currently on disk

func (*State) AllWaypoints

func (s *State) AllWaypoints(ctx context.Context, systemSymbol s10s.SystemSymbol) ([]*api.Waypoint, error)

func (*State) AllWaypointsStatic

func (s *State) AllWaypointsStatic(ctx context.Context, sys s10s.SystemSymbol) ([]*api.Waypoint, error)

func (*State) CacheAgeSystem

func (s *State) CacheAgeSystem(ctx context.Context, symbol s10s.SystemSymbol) time.Time

func (*State) CalcInterstellarJumpRoute

func (s *State) CalcInterstellarJumpRoute(ctx context.Context, from, to s10s.WaypointSymbol) ([]string, error)

func (*State) CalcInterstellarRoute

func (s *State) CalcInterstellarRoute(ctx context.Context, fuelCapa int, from, to s10s.WaypointSymbol) ([]string, error)

func (*State) CalcNavRoute

func (s *State) CalcNavRoute(ctx context.Context, ship *api.Ship, from, to s10s.WaypointSymbol) ([]RouteItem, error)

func (*State) CalcTravelDistance

func (s *State) CalcTravelDistance(ctx context.Context, ship *api.Ship, fromSymbol, toSymbol s10s.WaypointSymbol) (int, error)

func (*State) CalcWarpRoute

func (s *State) CalcWarpRoute(ctx context.Context, fuelCapa int, from, to s10s.WaypointSymbol) ([]string, error)

func (*State) Dump

func (s *State) Dump(ctx context.Context, fName string) (err error)

func (*State) FindEngineeredAsteroid

func (s *State) FindEngineeredAsteroid(ctx context.Context, sys s10s.SystemSymbol) (string, error)

func (*State) FindGasGiant

func (s *State) FindGasGiant(ctx context.Context, sys s10s.SystemSymbol) (string, error)

func (*State) FindInterstellarGood

func (state *State) FindInterstellarGood(ctx context.Context, good api.TradeSymbol) (<-chan *api.Market, error)

func (*State) FindInterstellarShipyards

func (s *State) FindInterstellarShipyards(ctx context.Context) (<-chan *api.Shipyard, error)

func (*State) FindWaypointBySymbol

func (s *State) FindWaypointBySymbol(ctx context.Context, wp s10s.WaypointSymbol) *api.Waypoint

func (*State) GetJumpGate

func (s *State) GetJumpGate(ctx context.Context, wp *api.Waypoint) (*api.JumpGate, error)

func (*State) GetMarketStatic

func (s *State) GetMarketStatic(ctx context.Context, wpSymbol s10s.WaypointSymbol) (*api.Market, error)

func (*State) GetMyAgent

func (s *State) GetMyAgent(ctx context.Context) (*api.Agent, error)

func (*State) GetPublicAgentStatic

func (s *State) GetPublicAgentStatic(ctx context.Context, agentSymbol string) (*api.Agent, error)

func (*State) GetShipyardStatic

func (s *State) GetShipyardStatic(ctx context.Context, wpSymbol s10s.WaypointSymbol) (*api.Shipyard, error)

func (*State) GetSystem

func (s *State) GetSystem(ctx context.Context, sysSym s10s.SystemSymbol) (*api.System, error)

func (*State) HasSystemCached

func (s *State) HasSystemCached(ctx context.Context, sysSymbol s10s.SystemSymbol) bool

func (*State) HasWaypointsCached

func (s *State) HasWaypointsCached(ctx context.Context, sysSymbol s10s.SystemSymbol) bool

func (*State) ListSystems

func (s *State) ListSystems(ctx context.Context) (<-chan *api.System, int, error)

func (*State) PersistCache

func (s *State) PersistCache(ctx context.Context) error

func (*State) PersistCacheOnce

func (s *State) PersistCacheOnce(ctx context.Context) error

func (*State) Ships

func (s *State) Ships() []*api.Ship

func (*State) SortByDist

func (s *State) SortByDist(ctx context.Context, ship *api.Ship, wps []*api.Waypoint) (func(a, b *api.Waypoint) int, error)

func (*State) StellarConstructionsStatic

func (s *State) StellarConstructionsStatic() ([]*api.Construction, error)

func (*State) StellarJumpGatesStatic

func (s *State) StellarJumpGatesStatic() ([]*api.JumpGate, error)

func (*State) SubscribedEvents

func (s *State) SubscribedEvents() map[string]interface{}

type Vert

type Vert struct {
	WP     *api.Waypoint
	Refuel bool
	FM     api.ShipNavFlightMode
	Start  bool
}

func NewVert

func NewVert(wp *api.Waypoint, fm api.ShipNavFlightMode) Vert

Jump to

Keyboard shortcuts

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