File tree Expand file tree Collapse file tree
src/Codebreaker.ViewModels/Pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ private async Task StartGameAsync(CancellationToken cancellationToken)
5959 SelectedFields = Enumerable . Range ( 0 , Game . NumberCodes )
6060 . Select ( i =>
6161 {
62- var field = new Field ( ) { PossibleColors = Game . FieldValues [ "colors" ] , PossibleShapes = Game . FieldValues . GetOrDefault ( "shapes" ) } ;
62+ var field = new Field ( ) ;
6363 field . PropertyChanged += ( object ? sender , PropertyChangedEventArgs args ) => MakeMoveCommand . NotifyCanExecuteChanged ( ) ;
6464 return field ;
6565 } )
@@ -74,7 +74,7 @@ private async Task MakeMoveAsync(CancellationToken cancellationToken)
7474 if ( Game is null )
7575 throw new InvalidOperationException ( "A game needs to be started before making a move" ) ;
7676
77- if ( SelectedFields . Any ( field => ! field . IsSet ) )
77+ if ( SelectedFields . Any ( field => field . Color is null ) )
7878 throw new InvalidOperationException ( "All colors need to be selected before making a move" ) ;
7979
8080 WeakReferenceMessenger . Default . Send ( new MakeMoveMessage ( new ( SelectedFields ) ) ) ;
You can’t perform that action at this time.
0 commit comments