Skip to content

Commit

Permalink
adding summator module
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseblank committed Jul 19, 2024
1 parent 8d7438c commit 27cddf8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/summator/summator.cpp
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 27cddf8

Please sign in to comment.