Files
GDevelop/Extensions/TimedEvent/TimedEventTools.cpp
T
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00

30 lines
879 B
C++

/**
GDevelop - Timed Event Extension
Copyright (c) 2011-2016 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#include "TimedEventTools.h"
#include "GDCpp/Runtime/RuntimeScene.h"
#include "TimedEventsManager.h"
namespace GDpriv {
namespace TimedEvents {
signed long long GD_EXTENSION_API
UpdateAndGetTimeOf(RuntimeScene& scene, gd::String timedEventName) {
TimedEventsManager& manager = TimedEventsManager::managers[&scene];
manager.timedEvents[timedEventName].UpdateTime(
scene.GetTimeManager().GetElapsedTime());
return manager.timedEvents[timedEventName].GetTime();
}
void GD_EXTENSION_API Reset(RuntimeScene& scene, gd::String timedEventName) {
TimedEventsManager& manager = TimedEventsManager::managers[&scene];
manager.timedEvents[timedEventName].Reset();
}
} // namespace TimedEvents
} // namespace GDpriv