From dd9bc0459f89cf57ef674972ef97dc1aef7b8521 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 15 May 2024 21:17:05 +0200 Subject: [PATCH] Reorganize methods --- README.md | 8 ++++---- src/modules/splashes.gd | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8be0e9b..4898b82 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ Unregisters all CORE modules. Adds a splash to the specified category. #### *CoreBaseModule* add_splashes(*String* category, *Array[String]* splashes) Adds an array of splashes to the specified category. -#### *CoreBaseModule* delete_category(*String* category) -Removes the specified category. -#### *Array[String]* get_categories()() -Returns a list of all categories. #### *CoreBaseModule* copy_splashes(*String* source_category, *String* target_category) Copies all splashes from the source category to the target category. +#### *Array[String]* get_categories()() +Returns a list of all categories. +#### *CoreBaseModule* delete_category(*String* category) +Removes the specified category. #### *String* get_random_splash(*String* category) Returns a random splash. diff --git a/src/modules/splashes.gd b/src/modules/splashes.gd index 2ae5671..eb28ee5 100644 --- a/src/modules/splashes.gd +++ b/src/modules/splashes.gd @@ -139,6 +139,13 @@ func add_splashes(category: String, splash_array: Array[String]) -> CoreBaseModu return self +## Copies all splashes from the source category to the target category. +func copy_splashes(source_category: String, target_category: String) -> CoreBaseModule: + if splashes.get(target_category) == null: splashes.merge({ target_category: splashes[source_category] }) + else: splashes[target_category].append_array(splashes[source_category]) + + return self + ## Returns a list of all categories. func list_categories() -> Array[String]: return core.misc.array_to_stringarray(splashes.keys()) @@ -149,13 +156,6 @@ func delete_category(category: String) -> CoreBaseModule: return self -## Copies all splashes from the source category to the target category. -func copy_splashes(source_category: String, target_category: String) -> CoreBaseModule: - if splashes.get(target_category) == null: splashes.merge({ target_category: splashes[source_category] }) - else: splashes[target_category].append_array(splashes[source_category]) - - return self - # +++ get splash +++ ## Returns a random splash func get_random_splash(category: String) -> String: