public Card RollCard(Squad team, IAction action, MatchMinute[] minutes)
        {
            PositionalArea positionalArea = ChanceHelper.PercentBase100Chance(action.PositionalChance, x => x.Value).Key;

            var sentOffCardIds = minutes.SelectMany(x => x.Events).Where(x => x is RedCard).Select(x => x.CardId);
            var cards          = team.Lineup[positionalArea.ToString()].Where(x => x != null && !sentOffCardIds.Contains(x.Id)).ToList();

            int r = _randomnessProvider.Next(cards.Count);

            return(cards.ElementAtOrDefault(r)); //returns null TODO fix rolling position with 0 cards due to sending off
        }
        public Squad InPossession(Models.Match.Match match, out Squad notInPossession, out int homeChance, out int awayChance)
        {
            homeChance = PossessionChance(match.HomeTeam.Squad, match);
            awayChance = PossessionChance(match.AwayTeam.Squad, match);

            var homePossession = ChanceHelper.CumulativeTrueOrFalse(homeChance, awayChance);

            if (homePossession)
            {
                notInPossession = match.AwayTeam.Squad;
                return(match.HomeTeam.Squad);
            }
            else
            {
                notInPossession = match.HomeTeam.Squad;
                return(match.AwayTeam.Squad);
            }
        }
 public IAction RollAction()
 {
     return(ChanceHelper.PercentBase100Chance(_actions, x => x.ChancePerMinute));
 }