ViewModel refactoring and simplification#174
Merged
christiannagel merged 16 commits intomainfrom Mar 20, 2024
Merged
Conversation
Replaced GameMode with messaegs being sent. Removed options and unnecessary service dependencies.
Closed
Contributor
christiannagel
left a comment
There was a problem hiding this comment.
breaking changes for the clients.
Change the version in https://github.com/CodebreakerApp/Codebreaker.Xaml/blob/main/src/Directory.Build.props
to 3.7 before we build this
VersionPrefix>3.7.0</VersionPrefix>
Updated the `VersionPrefix` in the `PropertyGroup` of the `Directory.Build.props` file from `3.6.0` to `3.7.0`.
christiannagel
approved these changes
Mar 20, 2024
Contributor
|
unit tests don't run successfully! @szv |
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.
Pull Request Summary
This pull request includes significant changes to the game logic and structure, with a focus on refactoring and simplifying the codebase. The changes are primarily in the
GamePageViewModel,Game, andMoveclasses.Major Changes
Package Update: The
Microsoft.Extensions.Optionspackage was updated from7.0.1to8.0.2.Class Removals: Several classes were removed, including
GameViewModel,MoveViewModel,GamePageViewModelOptions,GameMode,GameMoveValue,SelectionAndKeyPegs,GameStateChangedMessage, andGameMoveMessage.Class Additions: New classes were added, including
GameEndedMessage,GameStartedMessage,MakeMoveMessage,Field,Game, andMove.Refactoring of
GamePageViewModel: This class was refactored to remove dependencies onIDialogServiceandIOptions<GamePageViewModelOptions>, and to add dependencies onIGamesClientandIInfoBarService. TheStartGameAsyncandSetMoveAsyncmethods were also refactored.Refactoring of
GameandMoveclasses: TheGameclass was refactored to change theGameIdproperty toId, to add theIsFinishedproperty, and to change theFieldValuesandMovesproperties fromICollectiontoObservableCollection. TheMoveclass was refactored to remove theMoveIdandMoveNumberproperties, and to change theGuessPegsandKeyPegsproperties fromObservableCollectiontoICollection.Design Decisions
The refactoring of the
GamePageViewModel,Game, andMoveclasses was done to simplify the codebase and improve maintainability. The removal of certain classes and properties, and the addition of others, was done to streamline the game logic and make it more intuitive. The change in dependencies forGamePageViewModelwas made to improve the class's testability and decouple it from specific services. The changes in property types fromICollectiontoObservableCollection(and vice versa) were made to better reflect the nature of the data being handled.