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, and Move classes.
Major Changes
Package Update: The Microsoft.Extensions.Options package was updated from 7.0.1 to 8.0.2.
Class Removals: Several classes were removed, including GameViewModel, MoveViewModel, GamePageViewModelOptions, GameMode, GameMoveValue, SelectionAndKeyPegs, GameStateChangedMessage, and GameMoveMessage.
Class Additions: New classes were added, including GameEndedMessage, GameStartedMessage, MakeMoveMessage, Field, Game, and Move.
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.
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.
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
, andMove
classes.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
, andMove
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 forGamePageViewModel
was made to improve the class's testability and decouple it from specific services. The changes in property types fromICollection
toObservableCollection
(and vice versa) were made to better reflect the nature of the data being handled.