Exemplo n.º 1
0
    /// <summary>
    /// Tries the get plan.
    /// </summary>
    /// <returns>The get plan.</returns>
    /// <param name="currentState">Agentens current world state.</param>
    /// <param name="actions">Agentens tillgängliga actions.</param>
    public Queue <ActionID> TryGetPlan(WorldStateSet currentState, List <Action_Goap> actions)
    {
        var nodePlan = planner.FindPathFromGoal(currentState, this, actions);
        Queue <ActionID> actionPlan = new Queue <ActionID>(nodePlan.Count);

        foreach (Node_Goap node in nodePlan)
        {
            actionPlan.Enqueue(node.ID);
        }

        return(actionPlan);
    }