示例#1
0
        private void LoadWithSampleData()
        {
            ExamplePage page = new ExamplePage(
                "When I see fruit, move toward it.\nWhen I bump fruit, eat it.",
                new ReflexDesc[] {
                new ReflexDesc(
                    new string[] {
                    "sensor.eyes",
                    "filter.fruit",
                    "actuator.movement",
                    "selector.towardclosest",
                }),
                new ReflexDesc(
                    new string[] {
                    "sensor.bumpers",
                    "filter.fruit",
                    "actuator.eat",
                }),
            });


            ActorHelp example = new ActorHelp();

            example.description = "This is the actor description.";
            ExampleProgram program = new ExampleProgram();

            program.pages = new List <ExamplePage>();
            program.pages.Add(page);
            example.programs = new List <ExampleProgram>();
            example.programs.Add(program);
            instance.actorHelp.Add("BokuBot", example);
        }
示例#2
0
        /// <summary>
        /// Build an example program from the specified brain contents.
        /// </summary>
        /// <param name="brain"></param>
        /// <returns></returns>
        public static ExampleProgram FromBrain(Brain brain)
        {
            ExampleProgram program = new ExampleProgram();

            program.pages = new List <ExamplePage>();

            foreach (Task task in brain.tasks)
            {
                ExamplePage page = ExamplePage.FromTask(task);
                program.pages.Add(page);
            }

            return(program);
        }