[WIP] Test changement solid method#98
Open
Giovanniricotta2002 wants to merge 4 commits intoV2-Reactorfrom
Open
[WIP] Test changement solid method#98Giovanniricotta2002 wants to merge 4 commits intoV2-Reactorfrom
Giovanniricotta2002 wants to merge 4 commits intoV2-Reactorfrom
Conversation
…pendency injection
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request refactors the
ReactorControllerBlockEntityand related classes to improve encapsulation, support dependency injection, and separate concerns by introducing service interfaces for heat management and persistence. The changes make the codebase more maintainable, testable, and compliant with the Dependency Inversion Principle (DIP). Key logic for inventory and reactor state is now accessed via getters and setters, and persistence and heat calculation are delegated to dedicated service classes.Encapsulation and Accessor Refactoring:
ReactorControllerBlockEntityto private, providing public getter and setter methods for controlled access. This improves encapsulation and prepares the class for better testability and maintainability.ReactorControllerBlockandReactorControllerBlockEntityto use the new accessor methods instead of direct field access. [1] [2] [3]Dependency Injection and Service Abstraction:
IHeatService,DefaultHeatService) and persistence (IPersistenceService,DefaultPersistenceService). These are injected as dependencies intoReactorControllerBlockEntity, following DIP and enabling easier testing and extension. [1] [2] [3]HeatManagerand persistence logic with calls to the corresponding service interfaces. [1] [2] [3]Persistence and State Management:
Tick Logic and Method Extraction:
tickmethod inReactorControllerBlockEntityto extract sub-steps into private helper methods, improving readability and single responsibility. Added checks for readiness and separated entity resolution and heat update logic. [1] [2]Deprecation and Documentation:
@Deprecatedto indicate they are legacy and may be removed or replaced in the future. [1] [2]