Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/training impl #458

Merged
merged 15 commits into from
Jul 5, 2024
Merged

Feature/training impl #458

merged 15 commits into from
Jul 5, 2024

Conversation

tonihele
Copy link
Owner

@tonihele tonihele commented Jul 5, 2024

Allows creatures to train...

There is kinda duplicate time keeping for the training... It all kinda works. Task keeps check of validity and subtracts the money. ExperienceSystem then just deals with leveling the creature. Magically these systems are in sync as everything is executed sequentially. Not perhaps ideal but it conforms to our current design maybe the best...

@tonihele tonihele merged commit 0436f14 into master Jul 5, 2024
2 of 3 checks passed
@tonihele tonihele deleted the feature/training-impl branch July 5, 2024 20:20
@Trass3r Trass3r requested a review from Copilot November 23, 2024 11:37
Copy link

@Copilot 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.

Copilot reviewed 5 out of 19 changed files in this pull request and generated 1 suggestion.

Files not reviewed (14)
  • src/toniarts/openkeeper/game/controller/creature/CreatureController.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/component/TaskComponent.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/controller/room/TrainingRoomController.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/logic/CreatureExperienceSystem.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/logic/CreatureViewSystem.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/controller/GameController.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/state/MainMenuScreenController.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/task/worker/DigTileTask.java: Evaluated as low risk
  • src/toniarts/openkeeper/utils/WorldUtils.java: Evaluated as low risk
  • src/toniarts/openkeeper/view/text/CreatureTextParser.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/controller/room/AbstractRoomController.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/task/TaskType.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/controller/RoomControllerFactory.java: Evaluated as low risk
  • src/toniarts/openkeeper/game/task/creature/Train.java: Evaluated as low risk
Comments skipped due to low confidence (1)

src/toniarts/openkeeper/game/task/AbstractTask.java:168

  • Ensure that the method is covered by tests, especially the case where no accessible target is found.
protected Vector2f getAccessibleTargetNextToLocation(ICreatureController creature) {

* @param creature the creature trying to reach this
* @return task location next to the wanted tile
*/
protected Vector2f getAccessibleTargetNextToLocation(ICreatureController creature) {
Copy link
Preview

Copilot AI Nov 23, 2024

Choose a reason for hiding this comment

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

The nested loop in this method is redundant and could lead to performance issues. Additionally, the method does not handle the case where no accessible target is found, returning null without any indication of failure.

Suggested change
protected Vector2f getAccessibleTargetNextToLocation(ICreatureController creature) {
protected Optional<Vector2f> getAccessibleTargetNextToLocation(ICreatureController creature) {

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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.

1 participant