gametime

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLastPeriod

func GetLastPeriod(periodName string, roundNumber uint64) uint64

func GetZodiac

func GetZodiac(year int) string

func IsNight

func IsNight() bool

func MonthName

func MonthName(month int) string

func SetTime

func SetTime(setToHour int, setToMinutes ...int)

Jumps the clock forward a specific hour/minutes Between 0 and 23

func SetToDay

func SetToDay(roundAdjustment ...int)

Jumps the clock forward to the next day If a roundAdjustment is provided, it will be added to the offset This is useful to set to the round right before the rollover

func SetToNight

func SetToNight(roundAdjustment ...int)

Jumps the clock foward to the next night If a roundAdjustment is provided, it will be added to the offset This is useful to set to the round right before the rollover

Types

type GameDate

type GameDate struct {
	// The round number this GameDate represents
	RoundNumber      uint64
	RoundsPerDay     int
	NightHoursPerDay int

	Year        int
	Month       int
	Week        int
	Day         int
	Hour        int
	Hour24      int
	Minute      int
	MinuteFloat float64
	AmPm        string
	Night       bool

	DayStart   int
	NightStart int
}

func GetDate

func GetDate(forceRound ...uint64) GameDate

Gets the details of the current date

func (GameDate) Add

func (g GameDate) Add(adjustHours int, adjustDays int, adjustYears int) GameDate

func (GameDate) AddPeriod

func (g GameDate) AddPeriod(periodStr string) uint64

Example: gd := gametime.GetDate() nextPeriodRound := gd.AddPeriod(`10 days`) Accepts: x years, x months, x weeks, x days, x hours, x rounds If `IRL` or `real` are in the mix, such as `x irl days` or `x days irl`, then it will use real world time

func (*GameDate) ReCalculate

func (g *GameDate) ReCalculate()

func (GameDate) String

func (gd GameDate) String(symbolOnly ...bool) string

type RoundTimer

type RoundTimer struct {
	RoundStart uint64 `yaml:"roundstart,omitempty"`
	Period     string `yaml:"period,omitempty"`
	// contains filtered or unexported fields
}

func (RoundTimer) Expired

func (r RoundTimer) Expired() bool

Jump to

Keyboard shortcuts

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