示例#1
0
    private void GetWorldStatus()
    {
        GoapStatus goapStatus = goapGoal.GetWorldStatus();
        Dictionary <GoapCondition, object> statusDic = goapStatus.Status();

        sb.Remove(0, sb.Length);

        sb.AppendLine("WorldStatus:");
        foreach (var pair in statusDic)
        {
            string status = string.Format("{0}:{1}", pair.Key.ToString(), pair.Value.ToString());
            sb.AppendLine(status);
        }

        SetText(worldStatusText, sb.ToString());
    }
示例#2
0
    public GoapAction GetPerformerAction()
    {
        GoapAction goapAction = null;

        if (goapActionQueue.Count <= 0)
        {
            GoapStatus worldStatus = goapGoal.GetWorldStatus();
            GoapStatus goalStatus  = goapGoal.GetGoalStatus();

            goapActionQueue = goapPlan.Plan(usableGoapActionList, worldStatus, goalStatus);
        }

        if (goapActionQueue.Count <= 0)
        {
            return(goapAction);
        }

        goapAction = goapActionQueue.Dequeue();
        return(goapAction);
    }