示例#1
0
        private void Think()
        {
            _advancedRobot.Out.WriteLine("Thinking");

            if (_behaviours == null)
            {
                return;
            }
            foreach (BaseBehavior behaviour in _behaviours)
            {
                _advancedRobot.Out.WriteLine("Checking: {0}", behaviour);
                if (!behaviour.Condition())
                {
                    continue;
                }

                SelectedBehavior = behaviour;
                break;
            }

            _advancedRobot.Out.WriteLine("Execute: {0}", SelectedBehavior);
            SelectedBehavior.Execute();
        }