Skip to content

v3.7.0-beta.38-viewmodels

Pre-release
Pre-release
Compare
Choose a tag to compare
@christiannagel christiannagel released this 20 Mar 19:03
· 62 commits to main since this release
e4c23a4

What's Changed

  • ViewModel refactoring and simplification by @szv in #174
  • Fixed and enhanced ViewModel tests by @szv in #175

Full Changelog: v3.6.0-beta.34-viewmodels...v3.7-beta.38-viewmodels

Major Changes

  1. Package Update: The Microsoft.Extensions.Options package was updated from 7.0.1 to 8.0.2.

  2. Class Removals: Several classes were removed, including GameViewModel, MoveViewModel, GamePageViewModelOptions, GameMode, GameMoveValue, SelectionAndKeyPegs, GameStateChangedMessage, and GameMoveMessage.

  3. Class Additions: New classes were added, including GameEndedMessage, GameStartedMessage, MakeMoveMessage, Field, Game, and Move.

  4. Refactoring of GamePageViewModel: This class was refactored to remove dependencies on IDialogService and IOptions<GamePageViewModelOptions>, and to add dependencies on IGamesClient and IInfoBarService. The StartGameAsync and SetMoveAsync methods were also refactored.

  5. Refactoring of Game and Move classes: The Game class was refactored to change the GameId property to Id, to add the IsFinished property, and to change the FieldValues and Moves properties from ICollection to ObservableCollection. The Move class was refactored to remove the MoveId and MoveNumber properties, and to change the GuessPegs and KeyPegs properties from ObservableCollection to ICollection.

Design Decisions

The refactoring of the GamePageViewModel, Game, and Move classes 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 for GamePageViewModel was made to improve the class's testability and decouple it from specific services. The changes in property types from ICollection to ObservableCollection (and vice versa) were made to better reflect the nature of the data being handled.