示例#1
0
    /*
     *      Update
     *
     *      Purpose: This updates the object; it updates the AIBehavior first, then it executes
     *              each of the other EnemyBehaviors.
     */
    public override void Update()
    {
        base.Update();
        // All of our components define the behavior for this specefic enemy
        // so, we just call the components, and they do what is needed

        // The specefic order is such that the AIcomponent can made a decision
        // on what to do, then each of the additional components can act based on that position.

        // The AI comp. has to act first and make a decision
        intelComponent.Act();

        foreach (EnemyBehavior component in enemyComponents)
        {
            component.Act();
        }
    }