public BotActions SelectAction(Environment currentConditions) { BotActions rv = null; var i = 0; var attempts = 0; while (rv == null && attempts <= 10) { if (i >= this.Actions.Count) { i = 0; attempts++; } var testing = this.Actions[i]; if (testing.Conditions.DoesMatch(currentConditions)) { rv = testing; } i++; } if (rv == null) { var random = new BotActions().Random(); this.Actions.Add(random); rv = random; } return(rv); }
public void StrengthenAction(BotActions selectAction) { this.ChangeActionStrength(selectAction.Id, 10); }