using CommonAI.Zone.Helper; using CommonAI.Zone.Instance; using CommonLang; using System.Collections.Generic; using XmdsCommon.Plugin; using XmdsCommonServer.Plugin.Scene; namespace XmdsCommonServer.Plugin { public partial class XmdsVirtual_Player { #region 任务相关. private void InitQuestData() { if (mProp.ServerData.Tasks == null) { return; } List tasks = new List(); foreach (XmdsQuestData var in mProp.ServerData.Tasks) { QuestData qData = new QuestData(var.TaskID); if (var.TaskState == "1") { //已接受 qData.State = QuestState.Accepted; } foreach (QuestAttribute attr in var.Attributes) { qData.Attributes.Add(attr.Key, attr.Value); } tasks.Add(qData); } if (mUnit is InstancePlayer) { (mUnit as InstancePlayer).InitQuestData(tasks); } } #endregion /* private HashMap mQuestFlags = new HashMap(); private void InitQuestFlags() { mQuestFlags.Clear(); if (mUnit is InstancePlayer) { foreach (XmdsQuestFlag e in mProp.ServerData.QuestFlags) { if (!string.IsNullOrEmpty(e.FlagName) && !string.IsNullOrEmpty(e.FlagValue)) { mQuestFlags.Add(e.FlagName, e.FlagValue); if (!mProp.ServerData.PlayerEntered) { mUnit.Parent.queueTask((z) => { (mUnit.Parent as XmdsServerScene).GS_OnInitZonePlayerQuestFlagR2B(mUnit as InstancePlayer, e.FlagName, e.FlagValue); }); } } } } } internal void SetQuestFlag(string key, string value) { if (key != null) { if (value == null) { mQuestFlags.Remove(key); } else { mQuestFlags.Put(key, value); } } } internal string GetQuestFlag(string key) { return mQuestFlags.Get(key); } */ } }