Example #1
0
		public override bool ProcessInstruction(InstructionData sentInstruction)
		{
			//return false base process conditions are not met
			if (!base.ProcessInstruction(sentInstruction)) { return false; }
			StoryIndex tempIndex = new StoryIndex(sentInstruction.identifier);
			switch (sentInstruction.identifier.Length)
			{
				//Activate story
				case 2:
					ActivateStory(tempIndex);
					break;
				//Activate thread
				case 3:
					ActivateThread(tempIndex);
					break;
				//Increase stage
				case 4:
					IncreaseStoryStage(tempIndex);
					break;
				//Increase stage point
				case 5:
					IncreaseStagePoint(tempIndex, sentInstruction.identifier[4]);
					break;
			}
			return true;
		}
Example #2
0
 public void IncreaseStagePoint(StoryIndex sentIndex, int i)
 {
     if (GetActiveStagePlace() == sentIndex.StageID)
     {
         dataArray[GetActiveStagePlace()].IncreaseStagePoint(i);
     }
 }
Example #3
0
 public bool GetIsIndexedData(StoryIndex sentIndex)
 {
     if (sentIndex.ThreadID == id)
     {
         return(true);
     }
     return(false);
 }
Example #4
0
		public StoryIndex[] GetIndicies(List<Story> sentList)
		{
			StoryIndex[] tempArray = new StoryIndex[sentList.Count];
			for (int i = 0; i < tempArray.Length; i++)
			{
				tempArray[i] = sentList[i].ActiveIndex;
			}
			return tempArray;
		}
Example #5
0
		public void ActivateThread(StoryIndex sentIndex)
		{
			Story story;
			if (activeStoryDictionary == null) { activeStoryDictionary = new Dictionary<int, Story>(); }
			if (activeStoryDictionary.TryGetValue(sentIndex.StoryID, out story))
			{
				story.ActivateThread(sentIndex);
			}
		}
Example #6
0
 public void IncreaseStagePoint(StoryIndex sentIndex, int pointID)
 {
     for (int i = 0; i < dataArray.Length; i++)
     {
         if (dataArray[i].GetIsIndexedData(sentIndex))
         {
             dataArray[i].IncreaseStagePoint(sentIndex, pointID);
         }
     }
 }
Example #7
0
 public void ActivateThread(StoryIndex sentIndex)
 {
     for (int i = 0; i < dataArray.Length; i++)
     {
         if (dataArray[i].GetIsMatch(sentIndex) == true)
         {
             dataArray[i].Activate();
         }
     }
 }
Example #8
0
		public void IncreaseStagePoint(StoryIndex sentIndex, int stagePointID)
		{
			for (int i = 0; i < activeStories.Count; i++)
			{
				Story story = activeStories[i];
				if (story.GetIsIndexedStory(sentIndex))
				{
					story.IncreaseStagePoint(sentIndex, stagePointID);
				}
			}
		}
 public bool GetIsStoryActive(StoryIndex sentIndex)
 {
     for (int i = 0; i < GetActiveStoryIndicies().Length; i++)
     {
         if (GetActiveStoryIndicies()[i] == sentIndex)
         {
             return(true);
         }
     }
     return(false);
 }
Example #10
0
 public bool GetIsIndexedStory(StoryIndex sentIndex)
 {
     if (sentIndex.MythID == parentID)
     {
         if (sentIndex.StoryID == id)
         {
             return(true);
         }
     }
     return(false);
 }
 private StoryIndex[] GetIndiciesFromArray(Story[] sentStories)
 {
     if (sentStories == null)
     {
         return(null);
     }
     StoryIndex[] tempArray = new StoryIndex[sentStories.Length];
     for (int i = 0; i < sentStories.Length; i++)
     {
         tempArray[i] = sentStories[i].ActiveIndex;
     }
     return(tempArray);
 }
Example #12
0
    //Compare to another StoryIndex by hashcode
    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return(false);
        }
        if (obj.GetType() != this.GetType())
        {
            return(false);
        }
        StoryIndex sentIndex = (StoryIndex)obj;

        return(GetHashCode() == sentIndex.GetHashCode());
    }
Example #13
0
		public void IncreaseStoryStage(StoryIndex sentIndex)
		{
			for (int i = 0; i < activeStories.Count; i++)
			{
				Story story = activeStories[i];
				if (story.GetIsIndexedStory(sentIndex))
				{
					story.IncreaseStage(sentIndex);
				}
			}
			for (int i = 0; i < ActiveIndicies.Length; i++)
			{
				Debug.Log("Myth: " + ActiveIndicies[i].MythID + ", Story: " + ActiveIndicies[i].StoryID + ", Thread: " + ActiveIndicies[i].ThreadID + ", Stage: " + ActiveIndicies[i].StageID);
			}
		}
Example #14
0
		public void SetStories()
		{
			hardMythList = writer.ReadTFromJson();
			foreach (Myth myth in hardMythList.GetArray())
			{
				myth.SetDefault();
			}
			if (activeStories == null || activeStories.Count == 0)
			{
				Story startStory = (Story)hardMythList.GetIndexedData(new int[] { 1, 0 });
				activeStories.Add(startStory);
				StoryIndex startIndex = new StoryIndex(new int[] { 1, 0, 0, 0 });
				startStory.ActivateThread(startIndex);
			}
			ProgressStory();
		}
Example #15
0
		public void ActivateStory(StoryIndex sentIndex)
		{
			Story story = (Story)hardMythList.GetIndexedData(new int[] { sentIndex.MythID, sentIndex.StoryID });
			activeStories.Add(story);
			story.ActivateThread(sentIndex);
		}
Example #16
0
		public DataItem GetIndexedStory(StoryIndex sentIndex, int depth)
		{
			return HardMythList.GetIndexedData(sentIndex.IDs);
		}