Skip to content

Commit

Permalink
add summator module
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseblank committed Jul 19, 2024
1 parent 27cddf8 commit 9b63b21
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/summator/SCsub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SCsub

Import('env')

env.add_source_files(env.module_sources, "*.cpp")
7 changes: 7 additions & 0 deletions modules/summator/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# config.py

def can_build(env, platform):
return True

def configure(env):
pass
Empty file.
6 changes: 6 additions & 0 deletions modules/summator/register_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* register_types.h */

#include "modules/register_module_types.h"

void initialize_summator_module(ModuleInitializationLevel p_level);
void uninitialize_summator_module(ModuleInitializationLevel p_level);
8 changes: 7 additions & 1 deletion modules/summator/summator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ int Summator::get_total() const {
}

void Summator::_bind_methods() {
ClassDB::bind_method(D_METHOD("add", "value"), &Summator::add)
ClassDB::bind_method(D_METHOD("add", "value"), &Summator::add);
ClassDB::bind_method(D_METHOD("reset"), &Summator::reset);
ClassDB::bind_method(D_METHOD("get_total"), &Summator::get_total);
}

Summator::Summator() {
count = 0;
}

0 comments on commit 9b63b21

Please sign in to comment.