Skip to main content
The Deno 2 Release Candidate is here
Learn more
class WeatherGenerator
import { WeatherGenerator } from "https://deno.land/x/sptaki@1.2.0/generators/mod.ts";

Constructors

new
WeatherGenerator(
weightedRandomHelper: WeightedRandomHelper,
logger: ILogger,
randomUtil: RandomUtil,
timeUtil: TimeUtil,
applicationContext: ApplicationContext,
configServer: ConfigServer,
)

Properties

private
serverStartTimestampMS
protected
applicationContext: ApplicationContext
protected
configServer: ConfigServer
protected
logger: ILogger
protected
randomUtil: RandomUtil
protected
timeUtil: TimeUtil
protected
weatherConfig: IWeatherConfig
protected
weightedRandomHelper: WeightedRandomHelper

Methods

protected
getBsgFormattedInRaidTime(): string

Get server uptime seconds multiplied by a multiplier and add to current time as seconds Format to BSGs requirements

protected
getBSGFormattedTime(date: Date): string

Get current time formatted to fit BSGs requirement

protected
getRandomFloat(node: string): number
protected
getWeightedClouds(): number
protected
getWeightedFog(): number
protected
getWeightedRain(): number
protected
getWeightedWindSpeed(): number
protected
setCurrentDateTime(weather: IWeather): void

Set IWeather date/time/timestamp values to now

Get current + raid datetime and format into correct BSG format and return

Return randomised Weather data with help of config/weather.json

Get the current in-raid time