Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Comments

Better Handling for Annotation, Exception and Attack component#20

Merged
thnhmai06 merged 5 commits intomainfrom
dev
Oct 27, 2025
Merged

Better Handling for Annotation, Exception and Attack component#20
thnhmai06 merged 5 commits intomainfrom
dev

Conversation

@thnhmai06
Copy link
Member

No description provided.

Update JDK setup to use Eclipse Temurin 24
Renamed several classes and updated their package paths to improve organization (e.g., moved `AnchorPoint`, `EntityType`, and `CanExecute` to `typing.enums` and `typing.interfaces`). Updated import statements accordingly to reflect these changes.
…ling

Replace RuntimeException with BounceverseException in Bounceverse.java to provide more context on errors. The new exception class allows for additional details to be passed, enhancing error reporting.
Copilot AI review requested due to automatic review settings October 27, 2025 09:02
@thnhmai06 thnhmai06 self-assigned this Oct 27, 2025
@thnhmai06 thnhmai06 merged commit 84b0b3d into main Oct 27, 2025
18 checks passed
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 refactors the codebase to improve annotation handling, exception management, and component compatibility checking. The changes migrate from compile-time annotation processing to runtime validation, consolidate utility classes, and reorganize the package structure for better clarity.

Key Changes:

  • Replaced compile-time @SuitableEntity annotation processing with runtime @ForEntity validation using new Utilities.Compatibility methods
  • Renamed Utils class to Utilities and reorganized package structure (data.typestyping.enums, data.contractstyping.interfaces)
  • Introduced BounceverseException for game-specific error handling

Reviewed Changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
settings.properties Added comment header (with encoding issues)
gradle.properties Created new file with project metadata and comments (with encoding issues)
CanUndo.java, CanExecute.java Moved from data.contracts to typing.interfaces and updated JavaDoc
BounceverseException.java New custom exception class for game-specific errors
EntityType.java, DirectionUnit.java, AnchorPoint.java Moved from data.types to typing.enums and updated JavaDoc
ForEntity.java Changed retention policy from CLASS to RUNTIME and added compatibility checking reference
WallFactory.java, PaddleFactory.java, BallFactory.java, SceneFactory.java Made classes final and updated imports
BrickFactory.java Replaced @SuitableEntity with runtime compatibility checks and added new components
SuitableEntity.java, SuitableEntityProcessor.java Removed annotation and processor (replaced by runtime validation)
PhysicSystem.java, InputSystem.java, SettingsManager.java, LaunchOptions.java Updated references from Utils to Utilities
Component files (Shield.java, Attributes.java, etc.) Updated imports for reorganized packages
Attack.java Removed entity removal logic on zero health
Utilities.java Renamed from Utils and added new Compatibility class with validation methods
Bounceverse.java Updated to use BounceverseException instead of generic RuntimeException

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
# ?�y ch? l� khai b�o c?a application, ch? kh�ng ph?i project.
# N?u mu?n khai b�o project, h�y truy c?p /gradle.properties
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The comment text contains encoding errors. The Vietnamese text should be properly encoded in UTF-8. The garbled characters suggest the file is being saved with incorrect encoding.

Suggested change
# ?�y ch? l� khai b�o c?a application, ch? kh�ng ph?i project.
# N?u mu?n khai b�o project, h�y truy c?p /gradle.properties
# Đây chỉ là khai báo của application, chứ không phải project.
# Nếu muốn khai báo project, hãy truy cập /gradle.properties

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
# ?�y ch? l� khai b�o c?a project, ch? kh�ng ph?i application.
# N?u mu?n khai b�o application, h�y truy c?p /src/main/resources/settings.properties
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The comment text contains encoding errors. The Vietnamese text should be properly encoded in UTF-8. The garbled characters suggest the file is being saved with incorrect encoding.

Suggested change
# ?�y ch? l� khai b�o c?a project, ch? kh�ng ph?i application.
# N?u mu?n khai b�o application, h�y truy c?p /src/main/resources/settings.properties
# Đây chỉ là khai báo của project, chứ không phải application.
# Nếu muốn khai báo application, hãy truy cập /src/main/resources/settings.properties

Copilot uses AI. Check for mistakes.
*
*
* <h1>{@link CanUndo}</h1>
* <h1>%{@link CanUndo}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '%' character before {@link CanUndo}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>%{@link CanUndo}</h1>
* <h1>{@link CanUndo}</h1>

Copilot uses AI. Check for mistakes.
*
*
* <h1>{@link CanExecute}</h1>
* <h1>%{@link CanExecute}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '%' character before {@link CanExecute}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>%{@link CanExecute}</h1>
* <h1>{@link CanExecute}</h1>

Copilot uses AI. Check for mistakes.
/**
*
*
* <h1>!{@link BounceverseException}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '!' character before {@link BounceverseException}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>!{@link BounceverseException}</h1>
* <h1>{@link BounceverseException}</h1>

Copilot uses AI. Check for mistakes.
*
*
* <h1>{@link EntityType}</h1>
* <h1>#{@link EntityType}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '#' character before {@link EntityType}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>#{@link EntityType}</h1>
* <h1>{@link EntityType}</h1>

Copilot uses AI. Check for mistakes.
*
*
* <h1>{@link DirectionUnit}</h1>
* <h1>#{@link DirectionUnit}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '#' character before {@link DirectionUnit}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>#{@link DirectionUnit}</h1>
* <h1>{@link DirectionUnit}</h1>

Copilot uses AI. Check for mistakes.
*
*
* <h1>{@link AnchorPoint}</h1>
* <h1>#{@link AnchorPoint}</h1>
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The JavaDoc header contains an invalid '#' character before {@link AnchorPoint}. This should be removed as it's not standard JavaDoc syntax.

Suggested change
* <h1>#{@link AnchorPoint}</h1>
* <h1>{@link AnchorPoint}</h1>

Copilot uses AI. Check for mistakes.
}
throw new IllegalArgumentException(
String.format(
"Class '%s' does not compatible for entity has '%s' type.",
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

Grammatical error in the error message. Should be "is not compatible" instead of "does not compatible".

Suggested change
"Class '%s' does not compatible for entity has '%s' type.",
"Class '%s' is not compatible for entity has '%s' type.",

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant