Krypton icon indicating copy to clipboard operation
Krypton copied to clipboard

Weather

Open BomBardyGamer opened this issue 4 years ago • 0 comments

Introduction

This is my current design of the weather API that I want to go in to Krypton. It's a bit more complex than what I have seen in other APIs, so here's a list of some of its features:

  • Starting and stopping weather immediately
  • Queuing weather up for later application
  • Scheduling of weather starting and stopping
  • Proper per-world and per-player weather, and you can even apply the API to other things that may want controlling

The current design has Weather, which is simply a type that holds data about the weather, though this type is immutable, and does not hold any data that could tie it to a specific controller, so it can be easily reused. Then, the heart of the design is the WeatherController, which can be used to start and stop weather, queue weather, clear weather, and also schedule weather starting and stopping (TODO). There is also a container that holds a controller, mostly existing to avoid having to create two weather events, but it also allows users to create their own things that may have weather.

Questions that still remain unanswered:

  • Should we use a scheduler for weather at all?
  • Is this too much for something like weather?
  • Could this be abstracted and applied to other things in the API?

BomBardyGamer avatar Dec 17 '21 17:12 BomBardyGamer