public static int RuleToTrash(ActionContainer action) { var tempList = action.GetTempRuleList(); if (tempList.Count == 0) { throw new BasicBlankException("There are no rules to trash"); } return(tempList.GetRandomItem()); }
public static CustomBasicList <int> SimplifyRules(FluxxGameContainer gameContainer, ActionContainer actionContainer) { var maxs = actionContainer.RulesToDiscard; var howMany = gameContainer.Random.GetRandomNumber(maxs, 0); // can even choose 0 to discard if (howMany == 0) { return(new CustomBasicList <int>()); } var tempList = actionContainer.GetTempRuleList(); return(tempList.GetRandomList(false, howMany).ToCustomBasicList()); }