Reorganize methods

This commit is contained in:
JeremyStar™ 2024-05-15 21:17:05 +02:00
parent 2b4a7da347
commit dd9bc0459f
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 11 additions and 11 deletions

View file

@ -18,11 +18,11 @@ Unregisters all CORE modules.
Adds a splash to the specified category. Adds a splash to the specified category.
#### *CoreBaseModule* <u>add_splashes</u>(*String* <u>category</u>, *Array[String]* <u>splashes</u>) #### *CoreBaseModule* <u>add_splashes</u>(*String* <u>category</u>, *Array[String]* <u>splashes</u>)
Adds an array of splashes to the specified category. Adds an array of splashes to the specified category.
#### *CoreBaseModule* <u>delete_category</u>(*String* <u>category</u>)
Removes the specified category.
#### *Array[String]* <u>get_categories()</u>()
Returns a list of all categories.
#### *CoreBaseModule* <u>copy_splashes</u>(*String* <u>source_category</u>, *String* <u>target_category</u>) #### *CoreBaseModule* <u>copy_splashes</u>(*String* <u>source_category</u>, *String* <u>target_category</u>)
Copies all splashes from the source category to the target category. Copies all splashes from the source category to the target category.
#### *Array[String]* <u>get_categories()</u>()
Returns a list of all categories.
#### *CoreBaseModule* <u>delete_category</u>(*String* <u>category</u>)
Removes the specified category.
#### *String* <u>get_random_splash</u>(*String* <u>category</u>) #### *String* <u>get_random_splash</u>(*String* <u>category</u>)
Returns a random splash. Returns a random splash.

View file

@ -139,6 +139,13 @@ func add_splashes(category: String, splash_array: Array[String]) -> CoreBaseModu
return self 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. ## Returns a list of all categories.
func list_categories() -> Array[String]: func list_categories() -> Array[String]:
return core.misc.array_to_stringarray(splashes.keys()) return core.misc.array_to_stringarray(splashes.keys())
@ -149,13 +156,6 @@ func delete_category(category: String) -> CoreBaseModule:
return self 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 +++ # +++ get splash +++
## Returns a random splash ## Returns a random splash
func get_random_splash(category: String) -> String: func get_random_splash(category: String) -> String: