Exemple #1
0
    // newConnect must be in the unconnected list
    // also connects given neighbor to this
    public bool connectTwoNeighbors(RoomNodes newConnect)
    {
        int count = unconnectedNeighbors.Count;

        unconnectedNeighbors.Remove(newConnect);

        if (count > unconnectedNeighbors.Count)
        {
            connectedNeighbors.Add(newConnect);
            enableCorridor(newConnect.getID());               // activates gameobject
            inPath = true;
            newConnect.setInPath();
            return(true);
        }

        return(false);
    }