public IActionResult GetAllMoves(bool expand = false) { var moves = _moveService.GetAll(); var resources = _enrichmentProvider.EnrichManyMoves(moves, expand); return(Result(resources)); }
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}, теперь ваш ход."); }
public IHttpActionResult GetAllMoves() { var moves = _moveService.GetAll(); return(Result(moves)); }