-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/v108 #33
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
Merged
Merged
Feature/v108 #33
Conversation
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 commit adds dataclasses for the Field and Board classes in socha/api/plugin/penguins/board.py.
The dataclasses allow us to have more concise and readable code while also taking advantage of immutability and
hashability, which are important properties for the game logic.
Additionally, the commit replaces some method names with more descriptive ones and removes unnecessary comments
and type hints for constructor parameters.
The changes include:
Add @DataClass decorator to Field and Board classes
Remove constructor from Field class and replace with a more concise dataclass syntax
Replace board constructor parameter in Board class with board dataclass parameter
Rename _is_destination_valid method to is_destination_valid
Add Generator and Iterator type hints to method signatures when appropriate
Change some variable names to be more consistent with PEP 8 conventions
Add dataclasses to the coordinate module to simplify the implementation of Vector, CartesianCoordinate, and HexCoordinate classes. The Vector class now uses the @DataClass decorator and its attributes are defined in the class header. The __init__, __repr__, and __eq__ methods were removed. The Coordinate, CartesianCoordinate, and HexCoordinate classes are similarly modified to use the @DataClass decorator and define their attributes in the class header. The __init__, __repr__, and __eq__ methods were also removed. This commit improves code readability and reduces code redundancy.
maxblan
added a commit
that referenced
this pull request
May 12, 2023
feat(field): add test case for order feat(network): add test case for receiving xml data Feature/v108 (#33) * feat(penguins): Add dataclass for Field and Board This commit adds dataclasses for the Field and Board classes in socha/api/plugin/penguins/board.py. The dataclasses allow us to have more concise and readable code while also taking advantage of immutability and hashability, which are important properties for the game logic. Additionally, the commit replaces some method names with more descriptive ones and removes unnecessary comments and type hints for constructor parameters. The changes include: Add @DataClass decorator to Field and Board classes Remove constructor from Field class and replace with a more concise dataclass syntax Replace board constructor parameter in Board class with board dataclass parameter Rename _is_destination_valid method to is_destination_valid Add Generator and Iterator type hints to method signatures when appropriate Change some variable names to be more consistent with PEP 8 conventions * feat(plugin): add dataclasses to coordinate module Add dataclasses to the coordinate module to simplify the implementation of Vector, CartesianCoordinate, and HexCoordinate classes. The Vector class now uses the @DataClass decorator and its attributes are defined in the class header. The __init__, __repr__, and __eq__ methods were removed. The Coordinate, CartesianCoordinate, and HexCoordinate classes are similarly modified to use the @DataClass decorator and define their attributes in the class header. The __init__, __repr__, and __eq__ methods were also removed. This commit improves code readability and reduces code redundancy. * feat(GameClient): Add feature for headless running and administrator activities * feat: Add dataclass for GameState * refactor: typos and add "prepared" to regex * feat: add several dataclasses for the xml protocol to be able to administer * feat: add super class * feat: add configurations to Starter for headless and administrator mode * feat: add dataclass * fix: adjust tests for new dataclasses * refactor: typos and pep 8 * refactor: bump to 1.0.8 * fix(package builder): not copying main logic * fix(package builder): a bug that caused infinite copying * feat(socha): log levels and verbose option --------- improved(socha): code for readability (#32) Cleanup (#31) * cleanup(socha): code of pollution and generalized it * improved(socha): code for readability --------- add(contribution): new contribution guidelines (#22) Create CODE_OF_CONDUCT.md (#23) Create pull_request_template.md Fix typo (#30) Co-Authored-By: Falcon <35808469+FalconsSky@users.noreply.github.com>
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.
Description
Please include a summary of the change and which issue is fixed.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: