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

Method getLastDayOfCurrentWeek

game/state/gametime.cpp:162–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162unsigned int GameTime::getLastDayOfCurrentWeek() const
163{
164 const unsigned short dayOfWeek = getPtime(this->ticks).date().day_of_week();
165 unsigned int daysBeforeWeekEnd = 7 - dayOfWeek;
166 if (dayOfWeek == 0) // Already sunday
167 daysBeforeWeekEnd = 0;
168
169 return getPtime(this->ticks + (daysBeforeWeekEnd * TICKS_PER_DAY)).date().year_month_day().day;
170}
171
172unsigned int GameTime::getLastDayOfCurrentMonth() const
173{

Callers 1

eventOccurredMethod · 0.80

Calls 1

getPtimeFunction · 0.85

Tested by

no test coverage detected