Esempio n. 1
0
    void SetUpDefensePosition(DefenseNode[] dwall) //DefenseWall dwall)
    {
        //bool allthewaythrough = false;
        int nodeCounter = 0;
        int dwallLength = dwall.Length;

        for (int k = 0; k < currSurvivors.Length; k++)
        {
            DefenseNode target = null;

            for (int i = 0; i < dwallLength; i++)
            {
                DefenseNode currNode = dwall[i];

                if (currNode.GetOccupiedStatus() == OCCUPIED.NOT_OCCUPIED)
                {
                    target = currNode;
                    currSurvivors[k].SetDefensePoint(currNode);
                    if (currSurvivors[k].mvmtTracker == Moving.NOT_MOVING_ON_ASTAR)
                    {
                        currSurvivors[k].GetSurvivor().MoveTo(currNode.transform.position);
                    }
                    currNode.SetOccupiedStatus(OCCUPIED.SINGLE);
                    nodeCounter++;
                    //set mvmt tree ?
                    //allthewaythrough = false;
                    break;
                }
                else if (currNode.GetOccupiedStatus() == OCCUPIED.SINGLE && nodeCounter >= dwallLength)
                {
                    target = currNode;
                    currSurvivors[k].SetDefensePoint(currNode);
                    if (currSurvivors[k].mvmtTracker == Moving.NOT_MOVING_ON_ASTAR)
                    {
                        currSurvivors[k].GetSurvivor().MoveTo(currNode.transform.position);
                    }
                    currNode.SetOccupiedStatus(OCCUPIED.DOUBLE);

                    //again set tree? i don't think so...
                    //allthewaythrough = false;
                    break;
                }

                /*else if(allthewaythrough == false && i < dwallLength-1)
                 * {
                 *  continue;
                 * }
                 *
                 * allthewaythrough = true;*/
            }

            //set tree if target == null
            if (target == null)
            {
                //tree thing here to go out and about, too many hens in the house
            }
        }
    }
Esempio n. 2
0
 public void SetDefensePoint(DefenseNode n)
 {
     currDefensePoint = n;
 }