v3.7.0-beta.38-viewmodels
Pre-releaseWhat'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
-
Package Update: The
Microsoft.Extensions.Options
package was updated from7.0.1
to8.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 onIDialogService
andIOptions<GamePageViewModelOptions>
, and to add dependencies onIGamesClient
andIInfoBarService
. TheStartGameAsync
andSetMoveAsync
methods were also refactored. -
Refactoring of
Game
andMove
classes: TheGame
class was refactored to change theGameId
property toId
, to add theIsFinished
property, and to change theFieldValues
andMoves
properties fromICollection
toObservableCollection
. TheMove
class was refactored to remove theMoveId
andMoveNumber
properties, and to change theGuessPegs
andKeyPegs
properties fromObservableCollection
toICollection
.
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.