当前位置: 首页>>代码示例>>C#>>正文


C# Quest.Equals方法代码示例

本文整理汇总了C#中Quest.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Quest.Equals方法的具体用法?C# Quest.Equals怎么用?C# Quest.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quest的用法示例。


在下文中一共展示了Quest.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        /// <summary>
        /// Initialize configuration parameters. 
        /// This method must be first called on application start
        /// For GUI mode from Main Form constructor
        /// For CMD mode from main thread
        /// The rest of events can be bind later but those 3 are mandatory
        /// </summary>
        /// <param name="OnFirstTimeRun">OnFirstTimeRun event handler</param>
        /// <param name="OnConfigFileChanged">OnConfigFileChanged event handler</param>
        /// <param name="OnShowErrorMessage">OnShowErrorMessage event handler</param>
        public static void Initialize(FirstTimeRunHandler OnFirstTimeRun,
            ConfigFileChangedHandler OnConfigFileChanged,
            ShowErrorMessageHandler OnShowErrorMessage)
        {
            Process.EnterDebugMode();

            // Load the configuration file
            // Configuration must be loaded first of all.
            FirstTimeRun += OnFirstTimeRun;
            ConfigFileChanged += OnConfigFileChanged;
            ShowErrorMessage += OnShowErrorMessage;

            XmlManager.Init();

            //\\ TEST
            // SaveNpcData();

            // Everything else after
            LoadConfig();
            XmlManager.Merge(config.WoWInfo.Version);
            XmlManager.AfterInit();

            #if DEBUG
            List<Route> lr = new List<Route>();
            Route r1 = new Route(new Endpoint(EndpointTypes.UNDEF, "", new Vector3D(1, 1, 1)),
                new Endpoint(EndpointTypes.UNDEF, "", new Vector3D(100, 100, 100)), "", true);
            lr.Add(r1);
            RouteListManager.Waypoints.Add(1F, lr);

            Route r2 = RouteListManager.FindRoute(new Vector3D(2, 2, 2));
            if (!ReferenceEquals(r1, r2))
                throw new Exception("Waypoints access failed");

            //\\ Test
            // Quest merge test
            Quest q1 = new Quest(1, "Test 1", "Test", "", 1, new int[6], new string[3], "", "", "");
            Quest q2 = new Quest(1, "Test 1", "Test", "", 1, new int[6], new string[3], "", "", "");

            if (!q1.Equals(q2))
                 throw new Exception("Quest Test 1 failed");

            // Add link  and dest
            q2.Relations.Add(11);
            q2.DestName = "npc";

            // Merge
            q1.MergeWith(q2);

            // check
            if (!q1.DestName.Equals("npc"))
                throw new Exception("Quest Test 2 failed");

            if (!q1.RelatedTo.Equals("11"))
                throw new Exception("Quest Test 3 failed");

            // Add extra relation
            q2.Relations.Add("10");
            q1.MergeWith(q2);
            if (!q1.RelatedTo.Equals("10,11"))
                throw new Exception("Quest Test 4 failed");

            if (!typeof(IMergeable).IsAssignableFrom(typeof(Quest)))
                throw new Exception("Quest Test 5 failed");
            /*
            NPC npc1 = ndata.Items[0].Items[2];
            NPC npc2 = ndata.Items[0].Items[2];

            if (!npc1.Equals(npc2))
                Environment.Exit(1);
            */
            /*
            LuaFunction lf = CurWoWVersion.FindLuaFunction("GetNpcDialogInfo");
            string c = lf.Code;
            // string c = "{0} {{}} {{'dd','xx'}}";
            string s = string.Format(c, 1);
            */
            /*
            NPC npc = new NPC();

            npc.Name = "Test XXX";
            npc.WPList.Add(new Vector3D(1, 2, 3));
            npc.AddService(new ClassTrainingService("HUNTER"));
            npc.AddQuest(new QuestHeader("Catch if u can", 1));

            SaveNpcData(); */
            #endif
        }
开发者ID:gaknoia,项目名称:babbot,代码行数:97,代码来源:ProcessManager.cs


注:本文中的Quest.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。