Ejemplo n.º 1
0
    public static EndeavourFactory constructDefault(Label parent)
    {
        EndeavourFactory factory = (EndeavourFactory)types[0].GetConstructor(new System.Type[0]).Invoke(new object[0]);

        factory.goals = new List <Goal> ();
        return(factory);
    }
 public RechargeAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tagMap, Battery battery)
     : base(factory, controller, goals, tagMap)
 {
     powerStation = getTagOfType<Tag>(TagEnum.PowerStation);
     this.name = "recharge";
     this.battery = battery;
 }
 public InvestigateAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tags)
     : base(factory, controller, goals, tags)
 {
     //creationTime = System.DateTime.Now;
     creationTime = Time.time;
     this.name = "investigate";
     sound = getTagOfType<Tag>(TagEnum.Sound);
 }
    public PatrolAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tagMap)
        : base(factory, controller, goals, tagMap)
    {
        this.name = "patrol";

        PatrolTag patrolTag = getTagOfType<PatrolTag>(TagEnum.PatrolRoute);
        if (patrolTag.getPoints() == null || patrolTag.getPoints().Count == 0) {
            Debug.LogWarning("Patrol route '" + patrolTag.getLabelHandle().label.name + "' has no route points");
        }
        routePoints = patrolTag.getPointHandles();
    }
Ejemplo n.º 5
0
    public void doEndeavourList(Label label)
    {
        listFoldout(ref endeavoursExpanded, ref label.endeavours, "Endeavours");
        if (!endeavoursExpanded)
        {
            return;
        }

        for (int i = 0; i < label.endeavours.Length; ++i)
        {
            if (label.endeavours [i] == null)
            {
                label.endeavours [i] = EndeavourFactory.constructDefault(label);
            }
        }
        doArrayGUI(ref label.endeavours);
    }
 public SearchAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tags)
     : base(factory, controller, goals, tags)
 {
     this.name = "search";
     searchPoint = getTagOfType<Tag>(TagEnum.Searchable);
 }
Ejemplo n.º 7
0
 public HuntAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tags)
     : base(factory, controller, goals, tags)
 {
     target = getTagOfType<Tag>(TagEnum.Player);
     this.name = "hunt";
 }
 public ElectrocuteAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tagMap)
     : base(factory, controller, goals, tagMap)
 {
     this.name = "electrocute";
 }
 public DropSentryAction(EndeavourFactory parentFactory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tags)
     : base(parentFactory, controller, goals, tags)
 {
     name = "dropSentry";
     sentryPoint = getTagOfType<Tag>(TagEnum.SentryPoint);
 }
Ejemplo n.º 10
0
 public GuardAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tagMap)
     : base(factory, controller, goals, tagMap)
 {
     this.guardLocation = getTagOfType<Tag>(TagEnum.GuardPoint);
     this.name = "guard";
 }
Ejemplo n.º 11
0
 public IdleAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tags)
     : base(factory, controller, goals, tags)
 {
 }
 public ActivateSpawnerAction(EndeavourFactory factory, RobotController controller, List<Goal> goals, Dictionary<TagEnum, Tag> tagMap)
     : base(factory, controller, goals, tagMap)
 {
     name = "ActivateSpawner";
     spawner = getTagOfType<Tag>(TagEnum.Spawner).getLabelHandle().label.GetComponentInChildren<RobotSpawner>();
 }