types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package types contains exported types for various aspects of Salmon Run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForUpdate

func CheckForUpdate(client *http.Client, quiet bool) (errs []error)

CheckForUpdate downloads the latest version of this file and checks to see which version number is higher. If the downloaded version is higher, execution ends. If the binary version is higher, it warns about being a prerelease.

Types

type Event

type Event int

Event is an integer enum for denoting the event of a wave.

const (
	WaterLevels Event = iota
	Rush
	Fog
	GoldieSeeking
	Griller
	CohockCharge
	Mothership
)

The seven Salmon Run events.

func StringToEvent

func StringToEvent(inStr string) (*Event, []error)

StringToEvent returns a pointer to an Event if the Event matches the inputted string, otherwise it returns an error.

func (Event) String

func (e Event) String() (string, []error)

String returns the name of the Event, currently hardcoded as the en-US locale, or an error if the Event isn't a valid value.

type EventArr

type EventArr []Event

EventArr is a wrapper around an Event slice for the purpose of using the IsAllElementExist and HasElement functions.

func (*EventArr) HasElement

func (e *EventArr) HasElement(event Event) bool

HasElement finds whether the given Event is in the EventArr.

func (*EventArr) IsAllElementExist

func (e *EventArr) IsAllElementExist(arr EventArr) bool

IsAllElementExist finds whether the given EventArr contains every element in the EventArr being called on.

type Schedule

type Schedule struct {
	Result []struct {
		Start    string    `json:"start"`
		StartUtc time.Time `json:"start_utc"`
		StartT   int       `json:"start_t"`
		End      string    `json:"end"`
		EndUtc   time.Time `json:"end_utc"`
		EndT     int       `json:"end_t"`
		Stage    struct {
			Image string `json:"image"`
			Name  string `json:"name"`
		} `json:"stage"`
		Weapons []struct {
			ID    int    `json:"id"`
			Image string `json:"image"`
			Name  string `json:"name"`
		} `json:"weapons"`
	} `json:"result"`
}

Schedule is a struct of all the Salmon Run rotations since the game's launch.

func GetSchedules

func GetSchedules(client *http.Client) (Schedule, []error)

GetSchedules downloads and returns a filled Schedule, or all the errors it encounters along with a stack trace.

type Server

type Server struct {
	Address   string
	APIKey    string
	ShortName string
}

Server is a representation of an instance of a server of stat.ink or salmon-stats/api.

type Stage

type Stage int

Stage is an int enum of the stage for the rotation.

const (
	SpawningGrounds Stage = iota
	MaroonersBay
	LostOutpost
	SalmonidSmokeyard
	RuinsOfArkPolaris
)

The five Salmon Run stages.

func (*Stage) IsElementExists

func (s *Stage) IsElementExists(arr []Stage) bool

IsElementExists finds whether the given Stage is in the Stage slice.

func (Stage) String

func (s Stage) String() string

String returns the name of the Stage, currently hardcoded as the en-US locale.

type Tide

type Tide string

Tide is a string enum for denoting the water level of the wave.

const (
	Ht Tide = "HT"
	Nt Tide = "NT"
	Lt Tide = "LT"
)

The three tides.

type TideArr

type TideArr []Tide

TideArr is a wrapper around a Tide slice for the purpose of using the IsAllElementExist and HasElement functions.

func (*TideArr) HasElement

func (t *TideArr) HasElement(tide Tide) bool

HasElement finds whether the given Tide is in the TideArr.

func (*TideArr) IsAllElementExist

func (t *TideArr) IsAllElementExist(arr TideArr) bool

IsAllElementExist finds whether the given TideArr contains every element in the TideArr being called upon.

type WeaponSchedule

type WeaponSchedule string

WeaponSchedule consists of an indicator as to which weapons are in the shift.

const (
	RandommGrizzco WeaponSchedule = "random_gold"
	SingleRandom   WeaponSchedule = "single_random"
	FourRandom     WeaponSchedule = "four_random"
	Set            WeaponSchedule = "set"
)

The four possibilities for weapon set types.

func (*WeaponSchedule) IsElementExists

func (w *WeaponSchedule) IsElementExists(arr []WeaponSchedule) bool

IsElementExists finds whether the given WeaponSchedule is in the WeaponSchedule slice.

Jump to

Keyboard shortcuts

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