Example #1
0
        public IActionResult GetAllMoves(bool expand = false)
        {
            var moves     = _moveService.GetAll();
            var resources = _enrichmentProvider.EnrichManyMoves(moves, expand);

            return(Result(resources));
        }
Example #2
0
        public string HandlePlayingSession(ISession session)
        {
            var   currentPlayer = _playerService.GetCurrentPlayer(session.Id);
            IMove moveToUpdate  = _moveService.GetAll(currentPlayer.Id).OrderBy(t => t.Start).LastOrDefault();

            moveToUpdate = moveToUpdate.WithEnd(DateTime.Now);

            _moveService.Update(moveToUpdate);

            currentPlayer = _playerService.UpdateCurrentPlayer(session.Id);

            //TODO: refactor this
            _moveService.Add(new Move
            {
                Player   = (Player)currentPlayer,
                PlayerId = currentPlayer.Id,
                Start    = DateTime.Now,
            });

            return($"Отлично. {currentPlayer.Name}, теперь ваш ход.");
        }
Example #3
0
        public IHttpActionResult GetAllMoves()
        {
            var moves = _moveService.GetAll();

            return(Result(moves));
        }