Calendar API is ready
PitchBright opened this issue · 11 comments
The Calendar API that I was talking about with you, TheWeatherPony and CallMeFoxie… has been completed by Foxie, and is ready for use!
https://github.com/CallMeFoxie/Calendar/tree/1.7.10
Let's get this added to StellarSky to keep track of the days and years.
Awesome! People are already trying to make Stellar Sky work with other mods, that require a common calendar… so that's great news that you will add it!
I found it hard to implement compatibility with this API, since It does not allow double for year length.
Do you know the purpose of each methods of ICalendarProvider?
@CallMeFoxie Hello, That's because someone might want float version of getDaysInYear to know its actual length. One might use it for special purpose.
Also, I think there is no reason to make getTicksPerYear as int. One can define 3/4 tick as unit of time, then he cannot use this API.
Hi,
which one exactly do you want to be double? getDaysInYear()?
I would rather make it getDaysInYear(int year) (= year sensitive), as I feel that it would make much more sense. Possibly do the same for the other methods, too?
I see one problem with doubles -- if osmebody does not take in account the fact that it might have decimal point then with a simple multiplication it may drift off with a 0.25 offset (for example).
I would still prefer to make it year-sensitive instead? Or make both versions -- double getDaysInYear(), getTicksInYear() and then make int getDaysInYear(int year) and int getTicksInYear(int year) for actual calculations?
Also what about months? Shouldn't those need double as well then?
It was too hard to implement Calendar API directly, especially on month part.
So I decided to provide own api, and create separate mod about calendar,
which support both Stellar Sky and Calendar API.
I'm sure @CallMeFoxie could help you implement it.