|
1 | | -using System.Collections.ObjectModel; |
| 1 | +using Microsoft.Extensions.Options; |
2 | 2 |
|
3 | | -using Codebreaker.GameAPIs.Client; |
4 | | -using Codebreaker.GameAPIs.Client.Models; |
5 | | - |
6 | | -using CodeBreaker.ViewModels.Services; |
7 | | - |
8 | | -using CommunityToolkit.Mvvm.ComponentModel; |
9 | | -using CommunityToolkit.Mvvm.Input; |
10 | | -using CommunityToolkit.Mvvm.Messaging; |
11 | | - |
12 | | -using Microsoft.Extensions.Options; |
13 | | - |
14 | | -namespace CodeBreaker.ViewModels; |
| 3 | +namespace Codebreaker.ViewModels; |
15 | 4 |
|
16 | 5 | public enum GameMode |
17 | 6 | { |
@@ -118,7 +107,7 @@ private async Task StartGameAsync() |
118 | 107 |
|
119 | 108 | GameStatus = GameMode.Started; |
120 | 109 |
|
121 | | - Game = new Models.Game(gameId, "Game6x4", Name, DateTime.Now, numberCodes, maxMoves) |
| 110 | + Game = new Game(gameId, GameType.Game6x4, Name, DateTime.Now, numberCodes, maxMoves) |
122 | 111 | { |
123 | 112 | FieldValues = fieldValues |
124 | 113 | }; |
@@ -186,9 +175,9 @@ private async Task SetMoveAsync() |
186 | 175 |
|
187 | 176 | string[] guessPegs = Fields.Select(x => x.Value!).ToArray(); |
188 | 177 |
|
189 | | - (string[] results, bool ended, bool isVictory) = await _client.SetMoveAsync(_game.GameId, Name, GameType.Game6x4, _moveNumber, guessPegs); |
| 178 | + (string[] keyPegs, bool ended, bool isVictory) = await _client.SetMoveAsync(_game.GameId, Name, GameType.Game6x4, _moveNumber, guessPegs); |
190 | 179 |
|
191 | | - SelectionAndKeyPegs selectionAndKeyPegs = new(guessPegs, results, _moveNumber++); |
| 180 | + SelectionAndKeyPegs selectionAndKeyPegs = new(guessPegs, keyPegs, _moveNumber++); |
192 | 181 | GameMoves.Add(selectionAndKeyPegs); |
193 | 182 | GameStatus = GameMode.MoveSet; |
194 | 183 |
|
@@ -236,22 +225,6 @@ private void ClearSelectedColor() |
236 | 225 | SetMoveCommand.NotifyCanExecuteChanged(); |
237 | 226 | } |
238 | 227 |
|
239 | | - //private void SetGamerNameIfAvailable() |
240 | | - //{ |
241 | | - // string? gamerName = _authService.LastUserInformation?.GamerName; |
242 | | - |
243 | | - // if (string.IsNullOrWhiteSpace(gamerName)) |
244 | | - // { |
245 | | - // Name = string.Empty; |
246 | | - // IsNamePredefined = false; |
247 | | - // } |
248 | | - // else |
249 | | - // { |
250 | | - // Name = gamerName; |
251 | | - // IsNamePredefined = true; |
252 | | - // } |
253 | | - //} |
254 | | - |
255 | 228 | private void InitializeValues() |
256 | 229 | { |
257 | 230 | ClearSelectedColor(); |
|
0 commit comments