albion

package
v0.0.0-...-26119fc Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPortal

func AddPortal(portal Portal) error

AddPortal adds a new portal to the DB

func CleanupExpiredPortals

func CleanupExpiredPortals() error

CleanupExpiredPortals does what you think

func IsValidPortal

func IsValidPortal(portal Portal) (bool, error)

IsValidPortal checks that the portal is OK

func LoadZones

func LoadZones() error

LoadZones reads the "data-dump.json" file and loads it into memory

Types

type Portal

type Portal struct {
	Source   string    `json:"source"`
	Target   string    `json:"target"`
	Size     int       `json:"size"`
	Expires  time.Time `json:"expires"`
	TimeLeft float64   `json:"timeLeft"`
	// contains filtered or unexported fields
}

Portal describes a roads portal between two zones

func GetPortals

func GetPortals() ([]Portal, error)

GetPortals returns the portals in the DB

type Resource

type Resource struct {
	Name string `json:"name"`
	Tier string `json:"tier"`
}

Resource describes a resource node

type Zone

type Zone struct {
	Name      string     `json:"name"`
	Color     string     `json:"color"`
	Type      string     `json:"type"`
	Markers   []string   `json:"markers"`
	Resources []Resource `json:"resources"`
}

Zone describes a map in albion

func GetZones

func GetZones() []Zone

GetZones returns all zones in the DB

Jump to

Keyboard shortcuts

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