Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void StrengthenAction(BotActions selectAction)
 {
     this.ChangeActionStrength(selectAction.Id, 10);
 }