Ejemplo n.º 1
0
            public void AddSpellTagGroup(bool interrupt, bool removeFromInterrupts, string tagGroupID, params string[] aliases)
            {
                if (this.Tags.ContainsKey(tagGroupID))
                {
                    dlog("Tag group " + tagGroupID + " already exists, skipping this.");
                    return;
                }
                SpellTagGroup spellTag = new SpellTagGroup(interrupt, removeFromInterrupts, tagGroupID, aliases);

                foreach (KeyValuePair <string, SpellTagGroup> match in this.Tags.Where(mtag => mtag.Value.Aliases.Contains(spellTag.GroupID)))
                {
                    AddTagAliases(match.Key, aliases);
                }

                dlog("Adding new tag group with: ID = " + spellTag.GroupID + ", should interrupt: " + spellTag.Include + ", aliases:" + aliases.ToRealString());
                this.Tags.Add(spellTag.GroupID, spellTag);
            }
Ejemplo n.º 2
0
        static public InterrupterDatabase ReadDatabaseFromFile(string path)
        {
            string line;
            InterrupterDatabase output = new InterrupterDatabase();

            using (StreamReader file = new StreamReader(path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    string[] parts = line.Split('\t');
                    if (parts[0] == "Tag group:")
                    {
                        SpellTagGroup tag = new SpellTagGroup(parts[2].ToBoolean(), parts[3].ToBoolean(), parts[1], parts[4].Split(','));

                        output.Tags.Add(tag.GroupID, tag);
                    }
                    else if (parts[0] == "Spell:")
                    {
                        InterrupterSpell spell = new InterrupterSpell(parts[2].ToInt32(), parts[3].ToBoolean(), output.Tags, parts[4].Split(','));
                        output.Spells.Add(spell.ID, spell);
                    }
                    else if (parts[0] == "Unit:")
                    {
                        output.Units.Add(parts[1].ToString(), parts[2].ToBoolean());
                    }
                    else if (parts[0].StartsWith("//"))
                    {
                        continue;
                    }
                    else
                    {
                        Logging.WriteDebug("<Interrupter Ultimate> Invalid database line: " + line);
                    }
                }
            }
            return(output);
        }
        public static InterrupterDatabase ReadDatabaseFromFile(string path)
        {
            string line;
            InterrupterDatabase output = new InterrupterDatabase();
            using (StreamReader file = new StreamReader(path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    string[] parts = line.Split('\t');
                    if (parts[0] == "Tag group:")
                    {
                        SpellTagGroup tag = new SpellTagGroup(parts[2].ToBoolean(), parts[3].ToBoolean(), parts[1], parts[4].Split(','));

                        output.Tags.Add(tag.GroupID, tag);
                    }
                    else if (parts[0] == "Spell:")
                    {
                        InterrupterSpell spell = new InterrupterSpell(parts[2].ToInt32(), parts[3].ToBoolean(), output.Tags, parts[4].Split(','));
                        output.Spells.Add(spell.ID, spell);
                    }
                    else if (parts[0] == "Unit:")
                    {
                        output.Units.Add(parts[1].ToString(), parts[2].ToBoolean());
                    }
                    else if (parts[0].StartsWith("//"))
                    {
                        continue;
                    }
                    else
                    {
                        Logging.WriteDebug("<Interrupter Ultimate> Invalid database line: " + line);
                    }
                }
            }
            return output;
        }
            public void AddSpellTagGroup(bool interrupt, bool removeFromInterrupts, string tagGroupID, params string[] aliases)
            {
                if (this.Tags.ContainsKey(tagGroupID))
                {
                    dlog("Tag group " + tagGroupID + " already exists, skipping this.");
                    return;
                }
                SpellTagGroup spellTag = new SpellTagGroup(interrupt, removeFromInterrupts, tagGroupID, aliases);

                foreach (KeyValuePair<string, SpellTagGroup> match in this.Tags.Where(mtag => mtag.Value.Aliases.Contains(spellTag.GroupID)))
                {
                    AddTagAliases(match.Key, aliases);
                }

                dlog("Adding new tag group with: ID = " + spellTag.GroupID + ", should interrupt: " + spellTag.Include + ", aliases:" + aliases.ToRealString());
                this.Tags.Add(spellTag.GroupID, spellTag);
            }