Hierarchy

  • default

Constructors

  • Parameters

    • turns: number

    Returns default

Properties

dayLength: number = 3200
dayPercent: number = .625
frozenTime?: number

Accessors

  • get day(): number
  • Returns which day it is. Starts at 1.

    Returns number

  • get dayStart(): number
  • Returns number

  • get ticks(): number
  • The total number of ticks passed.

    Returns number

Methods

  • Returns a copy of this TimeManager as a new object

    Returns default

  • Returns how bright it is at the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

    Returns number

  • Returns the DayQuarter of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

    Returns DayQuarter

  • Returns the hour of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

      Internally calls getHourMinute

    • format: TimeFormat = TimeFormat.TwelveHour

    Returns number

  • Returns the hours and minutes of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

    Returns {
        hour: number;
        minute: number;
    }

    • hour: number
    • minute: number
  • Returns the minute of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

      Internally calls getHourMinute

    Returns number

  • Returns the PartOfDay of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

    Returns PartOfDayGranular

  • Returns a decimal representation of the current time. 0 is the start of the day, and 1 is the end.

    Parameters

    • tickOffset: number = 0

    Returns number

  • Returns a string representation of the given time.

    Parameters

    • time: number = ...

      The time to use, defaulting to the current time.

    • format: TimeFormat = TimeFormat.TwelveHour

      The format to use, defaulting to TimeFormat.TwelveHour

    Returns default

  • Checks if the given time is before a formatted time.

    Parameters

    • checkTime: string

      A formatted time.

    • time: number = ...

      The time to check, defaulting to the current time.

    Returns undefined | boolean

  • Returns if the given time is between two formatted times.

    Parameters

    • checkPast: string

      A formatted time to check if the given time is after.

    • checkBefore: string

      A formatted time to check if the given time is before.

    • currentTime: number = ...

    Returns undefined | boolean

  • Returns if the given time is at day.

    Parameters

    • time: number = ...

      The time to check, defaulting to the current time.

    Returns boolean

  • Returns whether time is frozen.

    Returns boolean

  • Returns if the given time is at night.

    Parameters

    • time: number = ...

      The time to check, defaulting to the current time.

    Returns boolean

  • Checks if the given time is after a formatted time.

    Parameters

    • checkTime: string

      A formatted time.

    • time: number = ...

      The time to check, defaulting to the current time.

    Returns undefined | boolean

  • Increments ticks.

    Parameters

    • amount: number = 1

    Returns void

  • Sets the current time from a dayNight number and a boolean flag of whether it's day or night.

    Used exclusively for save conversion.

    Parameters

    • dayNight: number
    • dayNightSwitch: 0 | 1

    Returns void

  • Sets the time.

    Parameters

    • time: number

      A number between 0 and 1, where 0 is the start of the day and 1 is the end.

      Setting the time with the result of getTime will likely not set to the same value. This method is provided for save conversion and utility, and should rarely be used.

    Returns default

Generated using TypeDoc