MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getWeek

Method getWeek

game/state/gametime.cpp:135–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135unsigned int GameTime::getWeek() const
136{
137 const date firstMonday = previous_weekday(GAME_START.date(), greg_weekday(Monday));
138 const date lastMonday = previous_weekday(getPtime(this->ticks).date(), greg_weekday(Monday));
139 const date_duration duration = lastMonday - firstMonday;
140 return duration.days() / 7 + 1;
141}
142
143unsigned int GameTime::getFirstDayOfCurrentWeek() const
144{

Callers 4

invasionMethod · 0.80
updateMethod · 0.80
createControlMethod · 0.80

Calls 1

getPtimeFunction · 0.85

Tested by

no test coverage detected