Example #1
0
        private TurnResult MovePlayerToLocation(TurnResult result, IPlayer player, IBoard board, RollResult rollResult)
        {
            var moveResult = moveService.MoveToLocation(player.Location, rollResult.Total);

            player.MoveToLocation(moveResult.CurrentLocation.LocationIndex);
            result.Locations.Add(moveResult.CurrentLocation.LocationIndex);
            result.EndingLocation = player.Location;

            foreach (var location in moveResult.LocationHistory)
            {
                location.ProcessPassingAction(player);
            }

            moveResult.CurrentLocation.ProcessLandingAction(player);

            return result;
        }