I want to generate events based on date and time. It's for a game that has events that are based on date and time. Randomizing would be predictable like getting the next date and time. I couldn't find any information online using the the keywords I could think about. I've here an example use:
DateTimeRandom rand = new DateTimeRandom(5 * 60 * 1000, 30 * 60 * 1000, 30 * 1000, 45 * 1000) // Every 5 to 30 minutes and last for 30 to 45 seconds.
// To get the next event:
LocalDateTime dateTimeNext = rand.nextEvent().
// To get the current event:
if (rand.hasCurrentEvent()) { // Here's the boolean I'm talking about in the title.
long millis = rand.getCurrentEventDuration(); // Duration in milliseconds.
long startMillis = rand.getEventStartTime(); // Start time of the event.
}
It's ok if time is in nanos.
The class I need DateTimeRandom
would have the following paramaters: (long min, long max, long minLength, long maxLength)
the parameters are meaning the time that's between every event, and the last two are for the length. I hope this is enough information. The question here is for input only, my questions is a more advanced: I try to make an game event system that will have random game events based on date and time, the events will be predictible so that the user that plays the game can see the next event. This would also be useful for weather events.