mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-10 00:28:23 +03:00
feat(util): add WowTime::SetHourAndMinute overload
This commit is contained in:
3 files changed
+25
No files matched your search
@@ -169,3 +169,14 @@ void WowTime::SetHourAndMinutes(int32_t minutes) {
|
||||
this->m_hour = minutes / 60;
|
||||
this->m_minute = minutes % 60;
|
||||
}
|
||||
|
||||
int32_t WowTime::SetHourAndMinutes(uint32_t hour, uint32_t minutes) {
|
||||
if (hour >= 24 || minutes >= 60) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this->m_hour = hour;
|
||||
this->m_minute = minutes;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -25,6 +25,7 @@ class WowTime {
|
||||
// Member functions
|
||||
int32_t GetHourAndMinutes();
|
||||
void SetHourAndMinutes(int32_t minutes);
|
||||
int32_t SetHourAndMinutes(uint32_t hour, uint32_t minutes);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user