sun

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name      = "sun"
	EntitySun = common.EntityType("sun")
)
View Source
const (
	StateAboveHorizon = "aboveHorizon"
	StateBelowHorizon = "belowHorizon"
)
View Source
const (
	AttrHorizonState  = "horizonState" // aboveHorizon|belowHorizon
	AttrPhase         = "phase"
	AttrAzimuth       = "azimuth"
	AttrElevation     = "elevation"
	AttrSunrise       = "sunrise"       // sunrise (top edge of the sun appears on the horizon)
	AttrSunset        = "sunset"        // sunset (sun disappears below the horizon, evening civil twilight starts)
	AttrSunriseEnd    = "sunriseEnd"    // sunrise ends (bottom edge of the sun touches the horizon)
	AttrSunsetStart   = "sunsetStart"   // sunset starts (bottom edge of the sun touches the horizon)
	AttrDawn          = "dawn"          // dawn (morning nautical twilight ends, morning civil twilight starts)
	AttrDusk          = "dusk"          // dusk (evening nautical twilight starts)
	AttrNauticalDawn  = "nauticalDawn"  // nautical dawn (morning nautical twilight starts)
	AttrNauticalDusk  = "nauticalDusk"  // nautical dusk (evening astronomical twilight starts)
	AttrNightEnd      = "nightEnd"      // night ends (morning astronomical twilight starts)
	AttrNight         = "night"         // night starts (dark enough for astronomical observations)
	AttrGoldenHourEnd = "goldenHourEnd" // morning golden hour (soft light, best DayTime for photography) ends
	AttrGoldenHour    = "goldenHour"    // evening golden hour starts
	AttrSolarNoon     = "solarNoon"     // solar noon (sun is in the highest position)
	AttrNadir         = "nadir"         // nadir (darkest moment of the night, sun is in the lowest position)

	AttrLat = "lat"
	AttrLon = "lon"
)
View Source
const (
	Sunrise = "sunrise" // sunrise (top edge of the sun appears on the horizon)
	Sunset  = "sunset"  // sunset (sun disappears below the horizon, evening civil twilight starts)

	SunriseEnd  = "sunriseEnd"  // sunrise ends (bottom edge of the sun touches the horizon)
	SunsetStart = "sunsetStart" // sunset starts (bottom edge of the sun touches the horizon)

	Dawn = "dawn" // dawn (morning nautical twilight ends, morning civil twilight starts)
	Dusk = "dusk" // dusk (evening nautical twilight starts)

	NauticalDawn = "nauticalDawn" // nautical dawn (morning nautical twilight starts)
	NauticalDusk = "nauticalDusk" // nautical dusk (evening astronomical twilight starts)

	NightEnd = "nightEnd" // night ends (morning astronomical twilight starts)
	Night    = "night"    // night starts (dark enough for astronomical observations)

	GoldenHourEnd = "goldenHourEnd" // morning golden hour (soft light, best DayTime for photography) ends
	GoldenHour    = "goldenHour"    // evening golden hour starts

	SolarNoon = "solarNoon" // solar noon (sun is in the highest position)
	Nadir     = "nadir"     // nadir (darkest moment of the night, sun is in the lowest position)
)

Variables

This section is empty.

Functions

func New

func New() plugins.Plugable

func NewAttr

func NewAttr() m.Attributes

func NewSettings

func NewSettings() m.Attributes

func NewStates

func NewStates() (states map[string]entity_manager.ActorState)

Types

type Actor

type Actor struct {
	entity_manager.BaseActor
	// contains filtered or unexported fields
}

func NewActor

func NewActor(entity *m.Entity,
	entityManager entity_manager.EntityManager,
	eventBus event_bus.EventBus) *Actor

func (*Actor) Spawn

func (e *Actor) Spawn() entity_manager.PluginActor

func (*Actor) UpdateSunPosition

func (e *Actor) UpdateSunPosition(now time.Time)

type DayTime

type DayTime struct {
	MorningName string
	Time        time.Time
}

type DayTimes

type DayTimes []DayTime

func (DayTimes) Len

func (l DayTimes) Len() int

Len ...

func (DayTimes) Less

func (l DayTimes) Less(i, j int) bool

Less ...

func (DayTimes) Swap

func (l DayTimes) Swap(i, j int)

Swap ...

Jump to

Keyboard shortcuts

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