Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Kivano GDscript utils

An asset by kubecz3k
The page banner background of a mountain and forest
Kivano GDscript utils hero image

Quick Information

0 ratings
Kivano GDscript utils icon image
kubecz3k
Kivano GDscript utils

# ClassUtilsClassUtils is a Godot Engine **singleton** designed to extend GDScript with features currently unavailable natively, specifically focused on **enforcing abstract function implementations**.## FeaturesAbstract Function Checking: Automatically identifies if concrete classes fail to implement abstract functions defined in their abstract parent classes.## How to Use1. Add as a Singleton: Add `class_utils.tscn` as a singleton in your Godot project settings.2. Mark Abstract Classes:Above your abstract class's `class_name` declaration, add the line: "@abstract_class"ex: "@abstract_class" class_name MyAbstractClass extends Node3. Mark Abstract Functions: Inside the body of any abstract function, add the following assertion: func my_abstract_function(): assert(false, ClassUtils.ABSTRACT_FUNCTION_MSG) # Your abstract function logic (if any default behavior is desired)# Promise Utility`Promise` is a helper class designed to simplify asynchronous workflows in GDScript. It allows you to `await` operations and check results in a structured way.### Example Usagevar promise: Promise = async_compute_value()await promise.wait_for_fulfill()assert(promise.is_correct(), promise.get_error())var computed_value: float = promise.get_result() as float

Supported Engine Version
4.1
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

ClassUtils

ClassUtils is a Godot Engine singleton designed to extend GDScript with features currently unavailable natively, specifically focused on enforcing abstract function implementations.

Features

  • Abstract Function Checking: Automatically identifies if concrete classes fail to implement abstract functions defined in their abstract parent classes.

How to Use

  1. Add as a Singleton: Add class_utils.tscn as a singleton in your Godot project settings.
  2. Mark Abstract Classes: Above your abstract class's class_name declaration, add the line:
    "@abstract_class"
    class_name MyAbstractClass
    extends Node
    
  3. Mark Abstract Functions: Inside the body of any abstract function, add the following assertion:
    func my_abstract_function():
        assert(false, ClassUtils.ABSTRACT_FUNCTION_MSG)
        # Your abstract function logic (if any default behavior is desired)
    

Promise Utility

Promise is a helper class designed to simplify asynchronous workflows in GDScript.
It allows you to await operations and check results in a structured way.

Example Usage

var promise: Promise = async_compute_value()
await promise.wait_for_fulfill()
assert(promise.is_correct(), promise.get_error())
var computed_value: float = promise.get_result() as float

Author

Jakub Grzesik

Origin

Originally implemented for the needs of MSEP-one.


# ClassUtils

ClassUtils is a Godot Engine **singleton** designed to extend GDScript with features currently unavailable natively, specifically focused on **enforcing abstract function implementations**.

## Features

Abstract Function Checking: Automatically identifies if concrete classes fail to implement abstract functions defined in their abstract parent classes.

## How to Use

1. Add as a Singleton:
Add `class_utils.tscn` as a singleton in your Godot project settings.
2. Mark Abstract Classes:
Above your abstract class's `class_name` declaration, add the line:
"@abstract_class"
ex:
"@abstract_class"
class_name MyAbstractClass
extends Node

3. Mark Abstract Functions:
Inside the body of any abstract function, add the following assertion:

func my_abstract_function():
assert(false, ClassUtils.ABSTRACT_FUNCTION_MSG)
# Your abstract function logic (if any default behavior is desired)



# Promise Utility

`Promise` is a helper class designed to simplify asynchronous workflows in GDScript.
It allows you to `await` operations and check results in a structured way.

### Example Usage

var promise: Promise = async_compute_value()
await promise.wait_for_fulfill()
assert(promise.is_correct(), promise.get_error())
var computed_value: float = promise.get_result() as float

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Kivano GDscript utils icon image
kubecz3k
Kivano GDscript utils

# ClassUtilsClassUtils is a Godot Engine **singleton** designed to extend GDScript with features currently unavailable natively, specifically focused on **enforcing abstract function implementations**.## FeaturesAbstract Function Checking: Automatically identifies if concrete classes fail to implement abstract functions defined in their abstract parent classes.## How to Use1. Add as a Singleton: Add `class_utils.tscn` as a singleton in your Godot project settings.2. Mark Abstract Classes:Above your abstract class's `class_name` declaration, add the line: "@abstract_class"ex: "@abstract_class" class_name MyAbstractClass extends Node3. Mark Abstract Functions: Inside the body of any abstract function, add the following assertion: func my_abstract_function(): assert(false, ClassUtils.ABSTRACT_FUNCTION_MSG) # Your abstract function logic (if any default behavior is desired)# Promise Utility`Promise` is a helper class designed to simplify asynchronous workflows in GDScript. It allows you to `await` operations and check results in a structured way.### Example Usagevar promise: Promise = async_compute_value()await promise.wait_for_fulfill()assert(promise.is_correct(), promise.get_error())var computed_value: float = promise.get_result() as float

Supported Engine Version
4.1
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers