Skip to content

Commit 1f341b8

Browse files
committed
Added start_on_init parameters to SimpleTimer (seika-engine-api).
1 parent 541d1e7 commit 1f341b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/scripting/python/python_script_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class PythonScriptContext : public ScriptContext {
5656
}
5757
}
5858

59+
// TODO: Place physics_process and process candidates into vector
5960
void PhysicsProcess(const Entity entity, const double deltaTime) override {
6061
PyGILState_STATE pyGilStateState = PyGILState_Ensure();
6162
{

src/core/scripting/python/python_source.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef PYTHON_SOURCE_H
22
#define PYTHON_SOURCE_H
33

4-
// Seika Engine API v0.11.0
4+
// Seika Engine API v0.11.1
55

66
using PythonSource = const std::string&;
77

@@ -1561,12 +1561,14 @@ static PythonSource PYTHON_SOURCE_SCENE_MODULE =
15611561

15621562
static PythonSource PYTHON_SOURCE_UTILS_MODULE =
15631563
"class SimpleTimer:\n"
1564-
" def __init__(self, wait_time: float, loops=False, timeout_func=None):\n"
1564+
" def __init__(self, wait_time: float, loops=False, timeout_func=None, start_on_init=False):\n"
15651565
" self.wait_time = wait_time\n"
15661566
" self.loops = loops\n"
15671567
" self.timeout_func = timeout_func\n"
15681568
" self.time_left = 0.0\n"
15691569
" self.running = False\n"
1570+
" if start_on_init:\n"
1571+
" self.start()\n"
15701572
"\n"
15711573
" def start(self) -> None:\n"
15721574
" self.time_left = self.wait_time\n"

0 commit comments

Comments
 (0)