void SayNarrative()
    {
        NarrativeObject narrObj = narrativeEngine.narrativeManager.GetHeaviestNarrativeKey(narrativeLayer);

        narrativeEngine.narrativeManager.SetcurrentNarrativeText(narrObj);
        string narrText = narrativeEngine.narrativeManager.currentNarrativeText.narrativeObject.keyValue;

        uiMaster.GetComponent <UIEngine>().DisplayNarrativeText(narrText);
        Debug.Log("I worked");
    }
Exemplo n.º 2
0
 public void AddNarrativeTextToList(NarrativeObject narrativeTextToAdd)
 {
     if (narrativeFullList.Contains(narrativeTextToAdd))
     {
         Debug.Log("There is already an item of that type " + narrativeTextToAdd + " as a key");
     }
     else
     //if it isn't in the list add it
     {
         Debug.Log("Adding " + narrativeTextToAdd + " to the registry");
         narrativeFullList.Add(narrativeTextToAdd);
     }
     //Assign key to state;
 }
//	public void AddCurrentNarrativeTextToHistory(){
//		currentNarrativeText.MarkTime ();
//		narrativeSelectionHistory.Add (narrativeIterationCount, currentNarrativeText);
//
//		narrativeIterationCount++;
//
//	}
//	public void AddNarrativeTextToList(string narrativeKeyName,BasicNarrativeText narrativeTextToAdd){
//		BasicNarrativeText temp = null;
//		if (narrativeFullList.TryGetValue(narrativeKeyName, out temp)){
//			Debug.Log ("There is already an item with the stateID " + narrativeKeyName + " as a key");
//		}else{
//		}
//		//Assign key to state;
//		narrativeTextToAdd.keyName = narrativeKeyName;
//		narrativeFullList.Add (narrativeKeyName, narrativeTextToAdd);
//	}
    public NarrativeObject GetHeaviestNarrativeKey(int narrativeLayer, List <NarrativeObject> listToCheck)
    {
        NarrativeObject winningText   = null;
        float           highestWeight = 0;

        foreach (NarrativeObject myText in listToCheck)
        {
            if (myText.narrativeObject.narrativeLayer == narrativeLayer)
            {
                if (myText.narrativeObject.narrativeWeight < highestWeight)
                {
                    winningText   = myText;
                    highestWeight = myText.narrativeObject.narrativeWeight;
                }
            }
        }
        return(winningText);
    }
 public void DoNarrative()
 {
     Debug.Log("Running do Narrative, true = layer, false = key " + t4Layerf4Key);
     if (t4Layerf4Key == true)
     {
         GameObject           nm  = GameObject.Find("NarrativeMaster");
         NarrativeEngine      ne  = nm.GetComponent <NarrativeEngine> ();
         BasicNarrativeEngine bse = ne.narrativeManager;
         NarrativeObject      bst = bse.GetHeaviestNarrativeKey(narrativeLayer);
         Debug.Log(bst);
         string tts = bst.narrativeObject.keyValue;
         //string textToShow= GameObject.Find("NarrativeMaster").GetComponent<NarrativeEngine> ().narrativeManager.GetHeaviestNarrativeKey (narrativeLayer).narrativeObject.keyValue;
         uiMaster.GetComponent <UIEngine> ().DisplayNarrativeText(tts);
     }
     else
     {
     }
 }
Exemplo n.º 5
0
    //This gets the most salient narrative element in the list, powerful tool can check on layers, or just strongest message overall.
    public NarrativeObject GetHeaviestNarrativeKey(int narrativeLayer = -1, List <NarrativeObject> listToCheck = null)
    {
        NarrativeObject winningText   = null;
        float           highestWeight = 0;

        if (listToCheck == null)
        {
            listToCheck = narrativeFullList;
        }
        if (narrativeLayer == -1)
        {
            // Debug.Log("Default state selected, polling all layers.");
            foreach (NarrativeObject myText in listToCheck)
            {
                if (myText.narrativeObject.narrativeWeight < highestWeight)
                {
                    winningText   = myText;
                    highestWeight = myText.narrativeObject.narrativeWeight;
                    // Debug.Log("New best heaviest text: " + myText + " with a weight of " + highestWeight);
                }
            }
        }
        else
        {
            //Debug.Log (" I am starting GetHeaviestNArrative Else condition " + narrativeLayer);
            foreach (NarrativeObject myText in listToCheck)
            {
                //Debug.Log (" I am doing the loop WHEEE Key " + myText);
                //Debug.Log (myText.narrativeObject.narrativeLayer + " vs " + narrativeLayer);
                if (myText.narrativeObject.narrativeLayer == narrativeLayer)
                {                 //Debug.Log (" I am looking at all of the heavy objects at layer " + narrativeLayer);
                    //Debug.Log (myText.narrativeObject.narrativeWeight + " and " + highestWeight);
                    if (myText.narrativeObject.narrativeWeight > highestWeight)
                    {
                        winningText   = myText;
                        highestWeight = myText.narrativeObject.narrativeWeight;
                        //Debug.Log("New best heaviest text: " + myText + " with a weight of " + highestWeight);
                    }
                }
            }
        }
        Debug.Log(winningText + " was selected");
        return(winningText);
    }
Exemplo n.º 6
0
 public void SetNextNarrativeText(NarrativeObject nextText)
 {
     nextNarrativeText = nextText;
 }
Exemplo n.º 7
0
 public void SetcurrentNarrativeText(NarrativeObject currentText)
 {
     currentNarrativeText = currentText;
 }