diff --git a/BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs b/BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs index d924368..8f2ab97 100644 --- a/BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs +++ b/BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs @@ -22,9 +22,29 @@ namespace MiniGames.Shared.Models }; } - public TicTacToeBrett(int[,] felder) + public TicTacToeBrett(int[,] werte) { - Felder = felder; + Felder = new int[3, 3]; + + if (werte == null) + { + werte = new int[0, 0]; + } + + for (int i = 0; i < Felder.GetLength(0); i++) + { + for (int j = 0; j < Felder.GetLength(1); j++) + { + if (i < werte.GetLength(0) && j < werte.GetLength(1)) + { + Felder[i, j] = werte[i, j]; + } + else + { + Felder[i, j] = LEER; + } + } + } } public bool Gleich(TicTacToeBrett anderes)