From 27cddf816b70fa1c2bbd52f01bf19c31c82e937a Mon Sep 17 00:00:00 2001 From: wiseblank Date: Thu, 18 Jul 2024 17:58:37 -0700 Subject: [PATCH] adding summator module --- modules/summator/summator.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/summator/summator.cpp b/modules/summator/summator.cpp index 25d0bde821dc..d3bf112482d9 100644 --- a/modules/summator/summator.cpp +++ b/modules/summator/summator.cpp @@ -3,5 +3,17 @@ #include "summator.h" void Summator::add(int p_value) { - + count += p_value; +} + +void Summator::reset() { + count = 0; +} + +int Summator::get_total() const { + return count; +} + +void Summator::_bind_methods() { + ClassDB::bind_method(D_METHOD("add", "value"), &Summator::add) } \ No newline at end of file