This repository was archived by the owner on Dec 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Better Handling for Annotation, Exception and Attack component #20
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
07bfda0
[skip ci] chore: remove `/system/` ignore folder
thnhmai06 74d861c
feat(Factory): use `HealthDeath` component instead of manual set deat…
thnhmai06 3e70c23
Merge pull request #18 from CodeStormOOP/main
thnhmai06 424d28e
refactor: Change `@SuitableFor` become a run-time function
thnhmai06 1ee601b
feat(exception): introduce BounceverseException for better error hand…
thnhmai06 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # ?漧 ch? l� khai b嫪 c?a project, ch? kh獼g ph?i application. | ||
| # N?u mu?n khai b嫪 application, h緉 truy c?p /src/main/resources/settings.properties | ||
| # | ||
| name=Bounceverse | ||
| group=com.github.codestorm | ||
| version=1.0.0-dev | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,8 +2,11 @@ | |||||
|
|
||||||
| import com.almasb.fxgl.dsl.FXGL; | ||||||
| import com.almasb.fxgl.entity.Entity; | ||||||
| import com.almasb.fxgl.entity.component.Component; | ||||||
| import com.almasb.fxgl.time.TimerAction; | ||||||
| import com.github.codestorm.bounceverse.data.types.DirectionUnit; | ||||||
| import com.github.codestorm.bounceverse.typing.annotations.ForEntity; | ||||||
| import com.github.codestorm.bounceverse.typing.enums.DirectionUnit; | ||||||
| import com.github.codestorm.bounceverse.typing.enums.EntityType; | ||||||
| import java.io.IOException; | ||||||
| import java.io.InputStream; | ||||||
| import java.util.*; | ||||||
|
|
@@ -12,8 +15,8 @@ | |||||
| import javafx.util.Duration; | ||||||
|
|
||||||
| /** Utilities. */ | ||||||
| public final class Utils { | ||||||
| private Utils() {} | ||||||
| public final class Utilities { | ||||||
| private Utilities() {} | ||||||
|
|
||||||
| /** Input/Output utilities. */ | ||||||
| public static final class IO { | ||||||
|
|
@@ -276,4 +279,74 @@ public static DirectionUnit getCollisionDirection(Entity source, Entity target) | |||||
| : direction.getY() > 0 ? DirectionUnit.DOWN : DirectionUnit.UP; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| public static final class Compatibility { | ||||||
| /** | ||||||
| * Throw {@link IllegalArgumentException} n廕簑 nh c籀 component trong {@code params} kh繫ng | ||||||
| * ph羅 h廙φ v廙 {@code onlyFor}. | ||||||
| * | ||||||
| * @param onlyFor {@link EntityType} mu廙 ki廙 tra tng th穩ch | ||||||
| * @param params C獺c component c廕吵 ki廙 tra | ||||||
| */ | ||||||
| public static void throwIfNotCompatible(EntityType onlyFor, Component... params) { | ||||||
| for (var param : params) { | ||||||
| final var annotation = param.getClass().getAnnotation(ForEntity.class); | ||||||
| if (annotation != null) { | ||||||
| final var paramSet = EnumSet.copyOf(Arrays.asList(annotation.value())); | ||||||
| if (paramSet.isEmpty() || paramSet.contains(onlyFor)) { | ||||||
| continue; | ||||||
| } | ||||||
| } | ||||||
| throw new IllegalArgumentException( | ||||||
| String.format( | ||||||
| "Class '%s' does not compatible for entity has '%s' type.", | ||||||
|
||||||
| "Class '%s' does not compatible for entity has '%s' type.", | |
| "Class '%s' is not compatible for entity has '%s' type.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/github/codestorm/bounceverse/components/behaviors/CooldownBehavior.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/github/codestorm/bounceverse/components/properties/Attributes.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/github/codestorm/bounceverse/components/properties/Shield.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.