/// <summary>
 /// </summary>
 /// <param name="description"> </param>
 /// <param name="code"> </param>
 /// <param name="group"> </param>
 public EventCode(string description, UInt64 code, EventGroup group)
 {
     Description = description;
     Code        = code;
     Group       = group;
 }
 /// <summary>
 /// </summary>
 /// <param name="name"> </param>
 /// <param name="parent"> </param>
 public EventGroup(string name, EventGroup parent = null)
 {
     this.Init(name, parent);
 }
Example #3
0
        /// <summary>
        /// </summary>
        /// <param name="root"> </param>
        /// <param name="parent"> </param>
        private void LoadGroups(XElement root, EventGroup parent)
        {
            var thisGroup = new EventGroup((string)root.Attribute("Name"), parent);
            var type      = (string)root.Attribute("Type");
            var subject   = (string)root.Attribute("Subject");
            var direction = (string)root.Attribute("Direction");

            if (type != null)
            {
                switch (type)
                {
                case "Damage":
                    thisGroup.Type = EventType.Damage;
                    break;

                case "Failed":
                    thisGroup.Type = EventType.Failed;
                    break;

                case "Actions":
                    thisGroup.Type = EventType.Actions;
                    break;

                case "Items":
                    thisGroup.Type = EventType.Items;
                    break;

                case "Cure":
                    thisGroup.Type = EventType.Cure;
                    break;

                case "Beneficial":
                    thisGroup.Type = EventType.Beneficial;
                    break;

                case "Detrimental":
                    thisGroup.Type = EventType.Detrimental;
                    break;

                case "System":
                    thisGroup.Type = EventType.System;
                    break;

                case "Battle":
                    thisGroup.Type = EventType.Battle;
                    break;

                case "Synthesis":
                    thisGroup.Type = EventType.Synthesis;
                    break;

                case "Gathering":
                    thisGroup.Type = EventType.Gathering;
                    break;

                case "Error":
                    thisGroup.Type = EventType.Error;
                    break;

                case "Echo":
                    thisGroup.Type = EventType.Echo;
                    break;

                case "Dialogue":
                    thisGroup.Type = EventType.Dialogue;
                    break;

                case "Loot":
                    thisGroup.Type = EventType.Loot;
                    break;

                case "Progression":
                    thisGroup.Type = EventType.Progression;
                    break;

                case "Defeats":
                    thisGroup.Type = EventType.Defeats;
                    break;
                }
            }

            if (subject != null)
            {
                switch (subject)
                {
                case "You":
                    thisGroup.Subject = EventSubject.You;
                    break;

                case "Party":
                    thisGroup.Subject = EventSubject.Party;
                    break;

                case "Other":
                    thisGroup.Subject = EventSubject.Other;
                    break;

                case "NPC":
                    thisGroup.Subject = EventSubject.NPC;
                    break;

                case "Alliance":
                    thisGroup.Subject = EventSubject.Alliance;
                    break;

                case "FriendlyNPC":
                    thisGroup.Subject = EventSubject.FriendlyNPC;
                    break;

                case "Pet":
                    thisGroup.Subject = EventSubject.Pet;
                    break;

                case "PetParty":
                    thisGroup.Subject = EventSubject.PetParty;
                    break;

                case "PetAlliance":
                    thisGroup.Subject = EventSubject.PetAlliance;
                    break;

                case "PetOther":
                    thisGroup.Subject = EventSubject.PetOther;
                    break;

                case "Engaged":
                    thisGroup.Subject = EventSubject.Engaged;
                    break;

                case "UnEngaged":
                    thisGroup.Subject = EventSubject.UnEngaged;
                    break;
                }
            }

            if (direction != null)
            {
                switch (direction)
                {
                case "Self":
                    thisGroup.Direction = EventDirection.Self;
                    break;

                case "You":
                    thisGroup.Direction = EventDirection.You;
                    break;

                case "Party":
                    thisGroup.Direction = EventDirection.Party;
                    break;

                case "Other":
                    thisGroup.Direction = EventDirection.Other;
                    break;

                case "NPC":
                    thisGroup.Direction = EventDirection.NPC;
                    break;

                case "Alliance":
                    thisGroup.Direction = EventDirection.Alliance;
                    break;

                case "FriendlyNPC":
                    thisGroup.Direction = EventDirection.FriendlyNPC;
                    break;

                case "Pet":
                    thisGroup.Direction = EventDirection.Pet;
                    break;

                case "PetParty":
                    thisGroup.Direction = EventDirection.PetParty;
                    break;

                case "PetAlliance":
                    thisGroup.Direction = EventDirection.PetAlliance;
                    break;

                case "PetOther":
                    thisGroup.Direction = EventDirection.PetOther;
                    break;

                case "Engaged":
                    thisGroup.Direction = EventDirection.Engaged;
                    break;

                case "UnEngaged":
                    thisGroup.Direction = EventDirection.UnEngaged;
                    break;
                }
            }

            foreach (XElement group in root.Elements("Group"))
            {
                this.LoadGroups(group, thisGroup);
            }

            foreach (XElement xElement in root.Elements("Code"))
            {
                var xKey         = Convert.ToUInt64((string)xElement.Attribute("Key"), 16);
                var xDescription = (string)xElement.Element("Description");
                this._eventCodes.Add(xKey, new EventCode(xDescription, xKey, thisGroup));
            }
        }
 /// <summary>
 /// </summary>
 /// <param name="kid"> </param>
 /// <returns> </returns>
 public EventGroup AddChild(EventGroup kid)
 {
     kid.Parent = this;
     return(this);
 }
 /// <summary>
 /// </summary>
 /// <param name="name"> </param>
 /// <param name="parent"> </param>
 private void Init(string name, EventGroup parent)
 {
     this.Name   = name;
     this.Parent = parent;
 }
Example #6
0
 /// <summary>
 /// </summary>
 /// <param name="name"> </param>
 /// <param name="parent"> </param>
 private void Init(string name, EventGroup parent)
 {
     Name   = name;
     Parent = parent;
 }
Example #7
0
 /// <summary>
 /// </summary>
 /// <param name="description"> </param>
 /// <param name="code"> </param>
 /// <param name="group"> </param>
 public EventCode(string description, ulong code, EventGroup group)
 {
     this.Description = description;
     this.Code        = code;
     this.Group       = group;
 }
 /// <summary>
 /// </summary>
 /// <param name="description"> </param>
 /// <param name="code"> </param>
 /// <param name="group"> </param>
 public EventCode(string description, UInt64 code, EventGroup group)
 {
     Description = description;
     Code = code;
     Group = group;
 }
 /// <summary>
 /// </summary>
 /// <param name="root"> </param>
 /// <param name="parent"> </param>
 private void LoadGroups(XElement root, EventGroup parent)
 {
     var thisGroup = new EventGroup((string) root.Attribute("Name"), parent);
     var type = (String) root.Attribute("Type");
     var subject = (String) root.Attribute("Subject");
     var direction = (String) root.Attribute("Direction");
     if (type != null)
     {
         switch (type)
         {
             case "Damage":
                 thisGroup.Type = EventType.Damage;
                 break;
             case "Failed":
                 thisGroup.Type = EventType.Failed;
                 break;
             case "Actions":
                 thisGroup.Type = EventType.Actions;
                 break;
             case "Items":
                 thisGroup.Type = EventType.Items;
                 break;
             case "Cure":
                 thisGroup.Type = EventType.Cure;
                 break;
             case "Beneficial":
                 thisGroup.Type = EventType.Beneficial;
                 break;
             case "Detrimental":
                 thisGroup.Type = EventType.Detrimental;
                 break;
             case "System":
                 thisGroup.Type = EventType.System;
                 break;
             case "Battle":
                 thisGroup.Type = EventType.Battle;
                 break;
             case "Synthesis":
                 thisGroup.Type = EventType.Synthesis;
                 break;
             case "Gathering":
                 thisGroup.Type = EventType.Gathering;
                 break;
             case "Error":
                 thisGroup.Type = EventType.Error;
                 break;
             case "Echo":
                 thisGroup.Type = EventType.Echo;
                 break;
             case "Dialogue":
                 thisGroup.Type = EventType.Dialogue;
                 break;
             case "Loot":
                 thisGroup.Type = EventType.Loot;
                 break;
             case "Progression":
                 thisGroup.Type = EventType.Progression;
                 break;
             case "Defeats":
                 thisGroup.Type = EventType.Defeats;
                 break;
         }
     }
     if (subject != null)
     {
         switch (subject)
         {
             case "You":
                 thisGroup.Subject = EventSubject.You;
                 break;
             case "Party":
                 thisGroup.Subject = EventSubject.Party;
                 break;
             case "Other":
                 thisGroup.Subject = EventSubject.Other;
                 break;
             case "NPC":
                 thisGroup.Subject = EventSubject.NPC;
                 break;
             case "Alliance":
                 thisGroup.Subject = EventSubject.Alliance;
                 break;
             case "FriendlyNPC":
                 thisGroup.Subject = EventSubject.FriendlyNPC;
                 break;
             case "Pet":
                 thisGroup.Subject = EventSubject.Pet;
                 break;
             case "PetParty":
                 thisGroup.Subject = EventSubject.PetParty;
                 break;
             case "PetAlliance":
                 thisGroup.Subject = EventSubject.PetAlliance;
                 break;
             case "PetOther":
                 thisGroup.Subject = EventSubject.PetOther;
                 break;
             case "Engaged":
                 thisGroup.Subject = EventSubject.Engaged;
                 break;
             case "UnEngaged":
                 thisGroup.Subject = EventSubject.UnEngaged;
                 break;
         }
     }
     if (direction != null)
     {
         switch (direction)
         {
             case "Self":
                 thisGroup.Direction = EventDirection.Self;
                 break;
             case "You":
                 thisGroup.Direction = EventDirection.You;
                 break;
             case "Party":
                 thisGroup.Direction = EventDirection.Party;
                 break;
             case "Other":
                 thisGroup.Direction = EventDirection.Other;
                 break;
             case "NPC":
                 thisGroup.Direction = EventDirection.NPC;
                 break;
             case "Alliance":
                 thisGroup.Direction = EventDirection.Alliance;
                 break;
             case "FriendlyNPC":
                 thisGroup.Direction = EventDirection.FriendlyNPC;
                 break;
             case "Pet":
                 thisGroup.Direction = EventDirection.Pet;
                 break;
             case "PetParty":
                 thisGroup.Direction = EventDirection.PetParty;
                 break;
             case "PetAlliance":
                 thisGroup.Direction = EventDirection.PetAlliance;
                 break;
             case "PetOther":
                 thisGroup.Direction = EventDirection.PetOther;
                 break;
             case "Engaged":
                 thisGroup.Direction = EventDirection.Engaged;
                 break;
             case "UnEngaged":
                 thisGroup.Direction = EventDirection.UnEngaged;
                 break;
         }
     }
     foreach (var group in root.Elements("Group"))
     {
         LoadGroups(group, thisGroup);
     }
     foreach (var xElement in root.Elements("Code"))
     {
         var xKey = Convert.ToUInt64((string) xElement.Attribute("Key"), 16);
         var xDescription = (string) xElement.Element("Description");
         _eventCodes.Add(xKey, new EventCode(xDescription, xKey, thisGroup));
     }
 }
 /// <summary>
 /// </summary>
 /// <param name="kid"> </param>
 /// <returns> </returns>
 public EventGroup AddChild(EventGroup kid)
 {
     kid.Parent = this;
     return this;
 }
 /// <summary>
 /// </summary>
 /// <param name="name"> </param>
 /// <param name="parent"> </param>
 private void Init(string name, EventGroup parent)
 {
     Name = name;
     Parent = parent;
 }
 /// <summary>
 /// </summary>
 /// <param name="name"> </param>
 /// <param name="parent"> </param>
 public EventGroup(string name, EventGroup parent = null)
 {
     Init(name, parent);
 }