public static bool FirstChainQuest(BaseQuest quest, object quester) { Type[] quests = null; if (quester is NewQuester) { NewQuester mQuester = (NewQuester)quester; quests = mQuester.Quests; } else if (quester is BaseQuestItem) { BaseQuestItem iQuester = (BaseQuestItem)quester; quests = iQuester.Quests; } if (quests != null) { for (int i = 0; i < quests.Length; i++) { if (quests[i] == quest.GetType()) { return(true); } } } return(false); }
public static Type FindFirstChainQuest(BaseQuest quest) { if (quest == null) { return(null); } Type[] quests = null; if (quest.Quester is NewQuester) { NewQuester mQuester = (NewQuester)quest.Quester; quests = mQuester.Quests; } else if (quest.Quester is BaseQuestItem) { BaseQuestItem iQuester = (BaseQuestItem)quest.Quester; quests = iQuester.Quests; } if (quests != null) { for (int i = 0; i < quests.Length; i++) { BaseQuest fQuest = Construct(quests[i]) as BaseQuest; if (fQuest != null && fQuest.ChainID == quest.ChainID) { return(fQuest.GetType()); } } } return(null); }