Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeManager

Hierarchy

  • TimeManager

Index

Constructors

constructor

  • Parameters

    • turns: number

    Returns TimeManager

Properties

dayLength

dayLength: number = 3200

dayStart

dayStart: number = 300

transitionPercent

transitionPercent: number = 0.5

Accessors

dayPercent

  • get dayPercent(): number
  • set dayPercent(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

nightPercent

  • get nightPercent(): number
  • set nightPercent(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

ticks

  • get ticks(): number
  • Returns number

Methods

getBrightness

  • getBrightness(time?: number): number
  • Parameters

    • Default value time: number = this.getTime()

    Returns number

getDayQuarter

  • Parameters

    • Default value time: number = this.getTime()

    Returns DayQuarter

getHour

  • getHour(time?: number, format?: TimeFormat): number
  • Parameters

    • Default value time: number = this.getTime()
    • Default value format: TimeFormat = TimeFormat.TwelveHour

    Returns number

getHourMinute

  • getHourMinute(time?: number): object
  • Parameters

    • Default value time: number = this.getTime()

    Returns object

    • hour: number
    • minute: number

getMinute

  • getMinute(time?: number): number
  • Parameters

    • Default value time: number = this.getTime()

    Returns number

getPartOfDay

  • Parameters

    • Default value time: number = this.getTime()

    Returns PartOfDay

getTime

  • getTime(): number
  • Returns number

getTimeFormat

  • getTimeFormat(time?: number, format?: TimeFormat): string
  • Parameters

    • Default value time: number = this.getTime()
    • Default value format: TimeFormat = TimeFormat.TwelveHour

    Returns string

isBefore

  • isBefore(checkTime: string, currentTime?: number): boolean
  • Parameters

    • checkTime: string
    • Default value currentTime: number = this.getTime()

    Returns boolean

isBetween

  • isBetween(checkPast: string, checkBefore: string, currentTime?: number): boolean
  • Parameters

    • checkPast: string
    • checkBefore: string
    • Default value currentTime: number = this.getTime()

    Returns boolean

isDay

  • isDay(time?: number): boolean
  • Parameters

    • Default value time: number = this.getTime()

    Returns boolean

isNight

  • isNight(time?: number): boolean
  • Parameters

    • Default value time: number = this.getTime()

    Returns boolean

isPast

  • isPast(checkTime: string, currentTime?: number): boolean
  • Parameters

    • checkTime: string
    • Default value currentTime: number = this.getTime()

    Returns boolean

nextTick

  • nextTick(): void
  • Returns void

restoreFromDayNight

  • restoreFromDayNight(dayNight: number, dayNightSwitch: 0 | 1): void
  • Parameters

    • dayNight: number
    • dayNightSwitch: 0 | 1

    Returns void

setTime

  • setTime(time: number): void
  • Parameters

    • time: number

    Returns void

Generated using TypeDoc