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; }
public void IncreaseStagePoint(StoryIndex sentIndex, int i) { if (GetActiveStagePlace() == sentIndex.StageID) { dataArray[GetActiveStagePlace()].IncreaseStagePoint(i); } }
public bool GetIsIndexedData(StoryIndex sentIndex) { if (sentIndex.ThreadID == id) { return(true); } return(false); }
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; }
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); } }
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); } } }
public void ActivateThread(StoryIndex sentIndex) { for (int i = 0; i < dataArray.Length; i++) { if (dataArray[i].GetIsMatch(sentIndex) == true) { dataArray[i].Activate(); } } }
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); }
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); }
//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()); }
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); } }
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(); }
public void ActivateStory(StoryIndex sentIndex) { Story story = (Story)hardMythList.GetIndexedData(new int[] { sentIndex.MythID, sentIndex.StoryID }); activeStories.Add(story); story.ActivateThread(sentIndex); }
public DataItem GetIndexedStory(StoryIndex sentIndex, int depth) { return HardMythList.GetIndexedData(sentIndex.IDs); }