Tibialyzer.Hunt.AddKillToHunt C# (CSharp) Method

AddKillToHunt() public method

public AddKillToHunt ( int>.Tuple resultList, string t, string message ) : void
resultList int>.Tuple
t string
message string
return void
        public void AddKillToHunt(Tuple<Creature, List<Tuple<Item, int>>> resultList, string t, string message)
        {
            lock (huntLock) {
                Creature cr = resultList.Item1;
                if (cr == null) {
                    foreach (Tuple<Item, int> tpl in resultList.Item2) {
                        Item item = tpl.Item1;
                        int count = tpl.Item2;
                        if (!this.loot.extraLoot.ContainsKey(item)) this.loot.extraLoot.Add(item, count);
                        else this.loot.extraLoot[item] += count;
                    }
                    return;
                }
                if (!this.loot.creatureLoot.ContainsKey(cr)) this.loot.creatureLoot.Add(cr, new Dictionary<Item, int>());
                foreach (Tuple<Item, int> tpl in resultList.Item2) {
                    Item item = tpl.Item1;
                    int count = tpl.Item2;
                    if (!this.loot.creatureLoot[cr].ContainsKey(item)) this.loot.creatureLoot[cr].Add(item, count);
                    else this.loot.creatureLoot[cr][item] += count;
                }
                if (!this.loot.killCount.ContainsKey(cr)) this.loot.killCount.Add(cr, 1);
                else this.loot.killCount[cr] += 1;

                if (!this.loot.logMessages.ContainsKey(t)) this.loot.logMessages.Add(t, new List<string>());
                this.loot.logMessages[t].Add(message);
            }
        }

Usage Example

Example #1
0
 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);
     }
 }
All Usage Examples Of Tibialyzer.Hunt::AddKillToHunt