public decimal CalculateProbability(Die die, IRollTarget target, IRollModifier modifier) { return(die.CalculateProbability(1) * die.CalculateProbability(target.GetModifiedSuccessfulSides(die.TotalSides, modifier).Count())); }
public IEnumerable <int> GetRerollSides(Die die, IRollTarget target) { return(new[] { 1 }); }
public decimal CalculateProbability(Die die, IRollTarget target, IRollModifier modifier) { var failures = die.TotalSides - target.GetSuccessfulSides(die.TotalSides).Count(); return(die.CalculateProbability(failures) * die.CalculateProbability(target.GetModifiedSuccessfulSides(die.TotalSides, modifier).Count())); }
public IEnumerable <int> GetRerollSides(Die die, IRollTarget target) { return(die.GetSides().Except(target.GetSuccessfulSides(die.TotalSides))); }
public decimal CalculateProbability(Die die, IRollTarget target, IRollModifier modifier) { return(0); }