core.utils package
Submodules
core.utils.aliases module
Aliases for various types used within Forge that do not need to be exposed.
core.utils.base module
Various base classes for Forge to organize code.
core.utils.dispatch module
Custom function-overloading in Python using Python decorators with type-hints.
- core.utils.dispatch.multidispatch(*types: Type)
Decorator for class methods using type-hints enabling, function-overloading using dynamic dispatch.
- Parameters
types (tuple[Type]) – Types to be overloaded.
core.utils.loaders module
Loaders for various assets in Forge.
- core.utils.loaders.load_sprites_from_folders(path: str) list[core.engine.sprite.Sprite]
Load files from various nested sub-folders as Forge sprites.
- Parameters
path (str) – Base or parent folder path.
- Returns
List of all sprites loaded from the sub-folders.
- Return type
core.utils.shapes module
Basic shapes in Forge.
- class core.utils.shapes.Circle(radius: float)
Bases:
Shape
Circle shape in Forge.
- area() float
Calculate the area of the circle.
- Returns
Area of the circle.
- Return type
float
- radius: float
- class core.utils.shapes.Rectangle(width: float, height: float)
Bases:
Shape
Rectangle shape in Forge.
- area() float
Calculate the area of the rectangle.
- Returns
Area of the rectangle.
- Return type
float
- height: float
- width: float