Ejemplo n.º 1
0
    public static int GetSizeOfTargetCluster(GameObject candidateNode, int targetTeam, List <GameObject> nodesList)
    {
        int        clusterSize     = 0;
        int        newDirection    = (candidateNode.GetComponent <Node>().direction + 1) % 4;
        GameObject destinationNode = TilesHelper.GetNeighbor(candidateNode, newDirection, nodesList);

        if (destinationNode != null)
        {
            int targetOwner = destinationNode.GetComponent <Node>().owner;
            if (targetOwner == targetTeam)
            {
                clusterSize = TilesHelper.GetClusterSize(destinationNode, nodesList);
            }
        }
        return(clusterSize);
    }