Esempio n. 1
0
    protected Node ST_SelectStory(StoryID id)
    {
        switch (id)
        {
        case StoryID.mainstoryarc:


            Node SelectmainStory = new SelectorParallel(
                new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))),
                this.ST_MainStoryArc());

            return(SelectmainStory);

        case StoryID.freeAdam1:


            Node SelectfreeAdam1 = new SelectorParallel(
                new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))),
                this.ST_freeAdam1());

            return(SelectfreeAdam1);

        default:
            return(null);
        }
    }
Esempio n. 2
0
 public override bool Equals(object obj)
 {
     if (obj is SimpleStory)
     {
         return(StoryID.Equals(((SimpleStory)obj).StoryID));
     }
     return(false);
 }
Esempio n. 3
0
    protected Node ST_CheckfreeAdam1Arc()
    {
        Node checkfreeAdam1arc = new Sequence(
            new LeafAssert(() => adam1Freed),
            new LeafInvoke(() => currentStoryID = StoryID.freeAdam1)
            );

        return(checkfreeAdam1arc);
    }
Esempio n. 4
0
    protected Node ST_CheckMainStoryArc()
    {
        Node checkmainarc = new Sequence(
            new LeafAssert(() => !adam1Freed),
            new LeafInvoke(() => currentStoryID = StoryID.mainstoryarc)
            );

        return(checkmainarc);
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        participants = findBAgent();
        Behavior     = new BehaviorEvent((Token toke) => this.BuildTreeRoot(), this.participants);

        //participants = findBAcrowd();
        //Crowd = new CrowdBehaviorEvent<AdamBehaviorTree>((AdamBehaviorTree tree, object token)=>this.BuildTreeRoot(),this.participants);


        currentStoryID = StoryID.mainstoryarc;
        adam1Freed     = false;
    }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        eventstatus = Behavior.Status;
        //eventstatus = Crowd.Status;

        if (Input.GetKeyDown(KeyCode.E))
        {
            Behavior.StartEvent(1f);
            //Crowd.StartEvent(1f);
        }
        if (Input.GetKeyDown(KeyCode.Q) && eventstatus == EventStatus.Running)
        {
            adam1Freed = true;
            Behavior.Drop(adam1.GetComponent <AdamBehaviorTree>().Object);
            //Crowd.Drop(adam1.GetComponent<AdamBehaviorTree>().Object);
        }
        if (eventstatus == EventStatus.Finished)
        {
            adam1Freed     = false;
            currentStoryID = StoryID.mainstoryarc;
        }
    }
Esempio n. 7
0
 public override int GetHashCode()
 {
     return(StoryID.GetHashCode());
 }