MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SetFromTable

Method SetFromTable

TombEngine/Scripting/Internal/TEN/Types/Time/Time.cpp:280–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278 }
279
280 void Time::SetFromTable(const sol::table& hmsTable)
281 {
282 if (!hmsTable.valid() || hmsTable.size() < 1 || hmsTable.size() > 4)
283 throw std::invalid_argument("Invalid time unit table. Expected {HH, MM, SS, [CC]}");
284
285 int hours = hmsTable.get_or(1, 0);
286 int minutes = hmsTable.get_or(2, 0);
287 int seconds = hmsTable.get_or(3, 0);
288 int cents = hmsTable.get_or(4, 0);
289
290 SetFromHMSC(hours, minutes, seconds, cents);
291 }
292}

Callers

nothing calls this directly

Calls 3

validMethod · 0.45
sizeMethod · 0.45
get_orMethod · 0.45

Tested by

no test coverage detected