Skip to content

Conversation

@CedNaru
Copy link
Member

@CedNaru CedNaru commented Sep 22, 2025

To make it possible I had to get rid of the code being split between different interfaces because it doesn't support @JvmStatic, necessary for Java to see them as static method.

Another alternative would be to create separate singleton GDPrint, GDMath, etc instead of them being interfaces.

@CedNaru CedNaru requested review from Copilot and piiertho September 22, 2025 03:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR consolidates the GD singleton from interface-based architecture to a single object to enable Java interoperability through @JvmStatic annotations. The interfaces didn't support @JvmStatic annotations which are necessary for Java to access methods as static.

Key changes:

  • Removed interface-based separation (GDMath, GDCore, GDRandom, GDPrint)
  • Consolidated all functionality into the GD object with @JvmStatic annotations
  • Made the RandomNumberGenerator instance private instead of part of an interface

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
GDRandom.kt Removed interface, functionality moved to GD object
GDPrint.kt Removed interface, functionality moved to GD object
GDMath.kt Removed interface, functionality moved to GD object
GDCore.kt Removed interface, functionality moved to GD object
GD.kt Consolidated all functionality from interfaces with @JvmStatic annotations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…/global/GD.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CedNaru CedNaru merged commit 8573874 into master Sep 28, 2025
175 of 178 checks passed
@CedNaru CedNaru deleted the improvement/GD-java-friendly branch September 28, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants