Exemplo n.º 1
0
        protected override ActionEnum GetAction(Random random, bool hasOneBite, int energyPoints)
        {
            var state = new Dictionary <int, int>
            {
                { 0, energyPoints < CreatureConstants.CriticalLevelOfFood ? 0 : -1 },
                { 1, hasOneBite ? 0 : -1 },
                { 2, energyPoints >= CreatureConstants.ChildPrice ? 0 : -1 }
            };

            var result = _executor.Execute(CommandsForGetAction, new MyExecutorToolset(random, state));

            return(ActionEx.ActionByNumber(int.Parse(result)));
        }