Exemplo n.º 1
0
    public static Node GetAiAttckNode(Node startingNode, Faction faction, Unit unit)
    {
        Node  desiredAttackNode  = null;
        float desireToAttackNode = 0;

        foreach (Node possibleAttackNode in MoveHelpers.GetPossibleAttackNodes(startingNode, faction))
        {
            var desire = unit.AiCalcDesireToAttackNode(possibleAttackNode);
            if (desire > desireToAttackNode)
            {
                desiredAttackNode  = possibleAttackNode;
                desireToAttackNode = desire;
            }
        }
        return(desiredAttackNode);
    }