Skip to content

Commit

Permalink
Added start_on_init parameters to SimpleTimer (seika-engine-api).
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Jan 9, 2022
1 parent 541d1e7 commit 1f341b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/scripting/python/python_script_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PythonScriptContext : public ScriptContext {
}
}

// TODO: Place physics_process and process candidates into vector
void PhysicsProcess(const Entity entity, const double deltaTime) override {
PyGILState_STATE pyGilStateState = PyGILState_Ensure();
{
Expand Down
6 changes: 4 additions & 2 deletions src/core/scripting/python/python_source.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PYTHON_SOURCE_H
#define PYTHON_SOURCE_H

// Seika Engine API v0.11.0
// Seika Engine API v0.11.1

using PythonSource = const std::string&;

Expand Down Expand Up @@ -1561,12 +1561,14 @@ static PythonSource PYTHON_SOURCE_SCENE_MODULE =

static PythonSource PYTHON_SOURCE_UTILS_MODULE =
"class SimpleTimer:\n"
" def __init__(self, wait_time: float, loops=False, timeout_func=None):\n"
" def __init__(self, wait_time: float, loops=False, timeout_func=None, start_on_init=False):\n"
" self.wait_time = wait_time\n"
" self.loops = loops\n"
" self.timeout_func = timeout_func\n"
" self.time_left = 0.0\n"
" self.running = False\n"
" if start_on_init:\n"
" self.start()\n"
"\n"
" def start(self) -> None:\n"
" self.time_left = self.wait_time\n"
Expand Down

0 comments on commit 1f341b8

Please sign in to comment.