Interface IGameCalendar
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Main API for retrieving anything calender or astronomy related
public interface IGameCalendar
- Extension Methods
Properties
CalendarSpeedMul
A multiplier thats applied to the progression of the calendar. Set this to 0.1 and a day will last 10 times longer, does not affect physics.
float CalendarSpeedMul { get; set; }
Property Value
DayOfYear
The current day of the year (goes from 0 to DaysPerYear)
int DayOfYear { get; }
Property Value
DayOfYearf
The current day of the year (goes from 0 to DaysPerYear)
float DayOfYearf { get; }
Property Value
DaysPerMonth
Amount of days per month
int DaysPerMonth { get; }
Property Value
DaysPerYear
Amount of days per year
int DaysPerYear { get; }
Property Value
ElapsedDays
Amount of in-game days that have passed since the game started
double ElapsedDays { get; }
Property Value
ElapsedHours
Amount of in-game hours that have passed since the game started
double ElapsedHours { get; }
Property Value
ElapsedSeconds
Amount of in-game seconds that have passed since the game started
long ElapsedSeconds { get; }
Property Value
FullHourOfDay
The current hour of the day as integer
int FullHourOfDay { get; }
Property Value
HourOfDay
The current hour of the day as decimal
float HourOfDay { get; }
Property Value
HoursPerDay
Amount of hours per day
float HoursPerDay { get; }
Property Value
Month
int Month { get; }
Property Value
MonthName
EnumMonth MonthName { get; }
Property Value
MoonPhase
The current moonphase
EnumMoonPhase MoonPhase { get; }
Property Value
MoonPhaseBrightness
The moons current brightness (higher during full moon)
float MoonPhaseBrightness { get; }
Property Value
MoonPhaseExact
The current moonphase represented by number from 0..8
double MoonPhaseExact { get; }
Property Value
MoonSize
The moons current size (larger during full moon)
float MoonSize { get; }
Property Value
OnGetHemisphere
Assigned by the survival mod. Must return the hemisphere at give location
HemisphereDelegate OnGetHemisphere { get; set; }
Property Value
OnGetLatitude
Assigned by the survival mod. Must return the latitude for given position. If not set, the calendar uses a default value of 0.5
-1 for south pole, 0 for equater, 1 for north pole
GetLatitudeDelegate OnGetLatitude { get; set; }
Property Value
OnGetSolarSphericalCoords
Assigned by the survival mod. The calendar uses this method to determine the solar altitude at given location and time. If not set, the calendar uses a default value of about 0.75
SolarSphericalCoordsDelegate OnGetSolarSphericalCoords { get; set; }
Property Value
SeasonOverride
float? SeasonOverride { get; set; }
Property Value
SpeedOfTime
This acts as a multiplier on how much faster an ingame second passes by compared to a real life second. Affects physics, like the motion speed of waving grass. The default is 60, hence per default a day lasts 24 minutes, but it's also multiplied by CalendarSpeedMul which is 0.5 by default so the end result is 48 minutes per day This is the sum of all modifiers
float SpeedOfTime { get; }
Property Value
Timelapse
Can be used to adjust apparent time of day and season for rendering, e.g. to create a series of timelapse images; restore to 0 when done
float Timelapse { get; set; }
Property Value
TotalDays
Total passed days since the game has started
double TotalDays { get; }
Property Value
TotalHours
Total passed hours since the game has started
double TotalHours { get; }
Property Value
Year
Returns the year. Every game begins with 1386
int Year { get; }
Property Value
YearRel
Returns the current season in a value of 0 to 1
float YearRel { get; }
Property Value
Methods
Add(float)
Adds given time to the calendar
void Add(float hours)
Parameters
hours
float
GetDayLightStrength(double, double)
Retrieve the current daylight strength at given coordinates, the values are roughly beween 0 and 1.2f
float GetDayLightStrength(double x, double z)
Parameters
Returns
GetDayLightStrength(BlockPos)
Retrieve the current daylight strength at given coordinates. The Y-Component is ignored
float GetDayLightStrength(BlockPos pos)
Parameters
pos
BlockPos
Returns
GetHemisphere(BlockPos)
Returns the hemisphere at given position
EnumHemisphere GetHemisphere(BlockPos pos)
Parameters
pos
BlockPos
Returns
GetMoonPosition(Vec3d, double)
Get the moons position in the sky at given date as a normalized vector
Vec3f GetMoonPosition(Vec3d position, double totaldays)
Parameters
Returns
GetSeason(BlockPos)
Returns the season at given position
EnumSeason GetSeason(BlockPos pos)
Parameters
pos
BlockPos
Returns
GetSeasonRel(BlockPos)
Returns the season at given position between 0..1, respects hemisphere
float GetSeasonRel(BlockPos pos)
Parameters
pos
BlockPos
Returns
GetSunPosition(Vec3d, double)
Get the suns position in the sky at given date as a normalized vector
Vec3f GetSunPosition(Vec3d pos, double totalDays)
Parameters
Returns
PrettyDate()
The worlds current date, nicely formatted
string PrettyDate()
Returns
RemoveTimeSpeedModifier(string)
To remove a previously added time speed modifier
void RemoveTimeSpeedModifier(string name)
Parameters
name
string
SetSeasonOverride(float?)
If non-null, will override the value retrieved by GetSeason(). Set to null to have seasons progress normally again.
void SetSeasonOverride(float? seasonRel)
Parameters
seasonRel
float?
SetTimeSpeedModifier(string, float)
If you want to modify the time speed, set a value here
void SetTimeSpeedModifier(string name, float speed)