當前位置: 首頁>>代碼示例>>C#>>正文


C# Hunt.AddKillToHunt方法代碼示例

本文整理匯總了C#中Tibialyzer.Hunt.AddKillToHunt方法的典型用法代碼示例。如果您正苦於以下問題:C# Hunt.AddKillToHunt方法的具體用法?C# Hunt.AddKillToHunt怎麽用?C# Hunt.AddKillToHunt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tibialyzer.Hunt的用法示例。


在下文中一共展示了Hunt.AddKillToHunt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Initialize

        public static void Initialize()
        {
            lock (hunts) {
                //"Name#DBTableID#Track#Time#Exp#SideHunt#AggregateHunt#ClearOnStartup#Creature#Creature#..."
                if (!SettingsManager.settingExists("Hunts")) {
                    SettingsManager.setSetting("Hunts", new List<string>() { "New Hunt#True#0#0#False#True" });
                }
                hunts.Clear();
                int activeHuntIndex = 0, index = 0;
                List<int> dbTableIds = new List<int>();
                foreach (string str in SettingsManager.getSetting("Hunts")) {
                    SQLiteDataReader reader;
                    Hunt hunt = new Hunt();
                    string[] splits = str.Split('#');
                    if (splits.Length >= 7) {
                        hunt.name = splits[0];
                        if (!int.TryParse(splits[1].Trim(), out hunt.dbtableid)) continue;
                        if (dbTableIds.Contains(hunt.dbtableid)) continue;
                        dbTableIds.Add(hunt.dbtableid);

                        hunt.totalTime = 0;
                        hunt.trackAllCreatures = splits[2] == "True";
                        double.TryParse(splits[3], NumberStyles.Any, CultureInfo.InvariantCulture, out hunt.totalTime);
                        long.TryParse(splits[4], out hunt.totalExp);
                        hunt.sideHunt = splits[5] == "True";
                        hunt.aggregateHunt = splits[6] == "True";
                        hunt.clearOnStartup = splits[7] == "True";
                        hunt.temporary = false;
                        string massiveString = "";
                        for (int i = 8; i < splits.Length; i++) {
                            if (splits[i].Length > 0) {
                                massiveString += splits[i] + "\n";
                            }
                        }
                        hunt.trackedCreatures = massiveString;
                        // set this hunt to the active hunt if it is the active hunt
                        if (SettingsManager.settingExists("ActiveHunt") && SettingsManager.getSettingString("ActiveHunt") == hunt.name)
                            activeHuntIndex = index;

                        refreshLootCreatures(hunt);

                        if (hunt.clearOnStartup) {
                            resetHunt(hunt);
                        }

                        // create the hunt table if it does not exist
                        LootDatabaseManager.CreateHuntTable(hunt);
                        // load the data for the hunt from the database
                        reader = LootDatabaseManager.GetHuntMessages(hunt);
                        while (reader.Read()) {
                            string message = reader["message"].ToString();
                            Tuple<Creature, List<Tuple<Item, int>>> resultList = Parser.ParseLootMessage(message);
                            if (resultList == null) continue;

                            string t = message.Substring(0, 5);

                            hunt.AddKillToHunt(resultList, t, message);
                        }
                        reader = LootDatabaseManager.GetUsedItems(hunt);
                        List<Tuple<Item, int>> usedItems = new List<Tuple<Item, int>>();
                        while (reader.Read()) {
                            int itemid = reader.GetInt32(0);
                            int amount = reader.GetInt32(1);
                            usedItems.Add(new Tuple<Item, int>(StorageManager.getItem(itemid), amount));
                        }
                        hunt.AddUsedItems(usedItems);
                        hunts.Add(hunt);
                        index++;
                    }
                }
                if (hunts.Count == 0) {
                    Hunt h = new Hunt();
                    h.name = "New Hunt";
                    h.dbtableid = 1;
                    hunts.Add(h);
                    resetHunt(h);
                }
                activeHunt = hunts[activeHuntIndex];
                MainForm.mainForm.InitializeHuntDisplay(activeHuntIndex);
            }
        }
開發者ID:Cizall,項目名稱:Tibialyzer,代碼行數:81,代碼來源:HuntManager.cs

示例2: AddKillToHunt

 public static void AddKillToHunt(Hunt h, Tuple<Creature, List<Tuple<Item, int>>> resultList, string t, string message, int stamp = 0, int hour = 0, int minute = 0, SQLiteTransaction transaction = null)
 {
     h.AddKillToHunt(resultList, t, message);
     if (transaction != null) {
         LootDatabaseManager.InsertMessage(h, stamp, hour, minute, message);
     }
 }
開發者ID:Cizall,項目名稱:Tibialyzer,代碼行數:7,代碼來源:HuntManager.cs


注:本文中的Tibialyzer.Hunt.AddKillToHunt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。