Beispiel #1
0
        public void TryAppendSavedGameMoves(TblGame game)
        {
            List <TblGame> gameMoves = GetAll();

            if (!gameMoves.Contains(game))
            {
                RepositoryProvider.GetRepository <TblGame>().Insert(game);
            }
        }
Beispiel #2
0
        public void AfterGameFinished(IGame game)
        {
            TblGame tblGame = new TblGame()
            {
                WinnerPlayerNumber = game.Winner?.PlayerNumber
            };

            foreach (var move in game.Moves)
            {
                tblGame.TblMove.Add(move);
            }

            Providers.ServiceProvider.GetService <GameService>().TryAppendSavedGameMoves(tblGame);
        }