diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-10-03 22:22:50 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-10-04 22:18:18 +0200 |
| commit | e127ad39e742396030352240d829bc903b1d4464 (patch) | |
| tree | 10cc21d70bf13181aef7c8ad0344077ff63579a3 /addons/gut/thing_counter.gd | |
| parent | ddbb045f6387a8ba23b1210b27a745516a387a52 (diff) | |
| download | texty-e127ad39e742396030352240d829bc903b1d4464.tar.xz texty-e127ad39e742396030352240d829bc903b1d4464.zip | |
godot: inital Godot 4 migration
Diffstat (limited to 'addons/gut/thing_counter.gd')
| -rw-r--r-- | addons/gut/thing_counter.gd | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/addons/gut/thing_counter.gd b/addons/gut/thing_counter.gd deleted file mode 100644 index a9b0b48..0000000 --- a/addons/gut/thing_counter.gd +++ /dev/null @@ -1,43 +0,0 @@ -var things = {} - -func get_unique_count(): - return things.size() - -func add(thing): - if(things.has(thing)): - things[thing] += 1 - else: - things[thing] = 1 - -func has(thing): - return things.has(thing) - -func get(thing): - var to_return = 0 - if(things.has(thing)): - to_return = things[thing] - return to_return - -func sum(): - var count = 0 - for key in things: - count += things[key] - return count - -func to_s(): - var to_return = "" - for key in things: - to_return += str(key, ": ", things[key], "\n") - to_return += str("sum: ", sum()) - return to_return - -func get_max_count(): - var max_val = null - for key in things: - if(max_val == null or things[key] > max_val): - max_val = things[key] - return max_val - -func add_array_items(array): - for i in range(array.size()): - add(array[i]) |
