events

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const StatusEvent = statusT("Status")

Variables

This section is empty.

Functions

func EventNames

func EventNames() []string

func Peek

func Peek(str []byte) (t time.Time, event string, err error)

func RegisterType

func RegisterType(name string, t Type)

Types

type Common

type Common struct {
	Time time.Time `json:"timestamp"`
	Tag  string    `json:"event"`
}

func (*Common) Event

func (c *Common) Event() string

func (*Common) Timestamp

func (c *Common) Timestamp() time.Time

type Event

type Event interface {
	Timestamp() time.Time
	Event() string
}

type Status

type Status struct {
	Common
	Flags     StatusFlag
	Pips      [3]int
	FireGroup int
	Fuel      struct {
		Main      float64 `json:"FuelMain"`
		Reservoir float64 `json:"FuelReservoi"`
	}
}

func (*Status) AllFlags

func (s *Status) AllFlags(fs StatusFlag) bool

func (*Status) AnyFlag

func (s *Status) AnyFlag(fs StatusFlag) bool

type StatusFlag

type StatusFlag uint32
const (
	FStatusDocked StatusFlag = (1 << iota)
	FStatusLanded
	FStatusGearDown
	FStatusShieldsUp
	FStatusSupercruise

	FStatusFAOff
	FStatusHPDeployed
	FStatusInWing
	FStatusLightsOn
	FStatusCSDeployed

	FStatusSilentRun
	FStatusFuelScooping
	FStatusSrvHandbrake
	FStatusSrvTurret
	FStatusSrvUnderShip

	FStatusSrvDriveAssist
	FStatusFsdMassLock
	FStatusFsdCharging
	FStatusCooldown
	FStatusLowFuel

	FStatusOverHeat
	FStatusHasLatLon
	FStatusIsInDanger
	FStatusInterdicted
	FStatusInMainShip

	FStatusInFighter
	FStatusInSrv
	FStatusHudAnalysis
	FStatusNightVis
	FStatusAltAvgR
)

Read: https://forums.frontier.co.uk/forums/elite-api-and-tools/

type Type

type Type interface {
	fmt.Stringer
	New() Event
}

func EventType

func EventType(event string) Type

Jump to

Keyboard shortcuts

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