Exemplo n.º 1
0
        public AddOn(ICsLuaAddOn csLuaAddOn)
        {
            this.csLuaAddOn = csLuaAddOn;

            var addonType            = csLuaAddOn.GetType();
            var csLuaAddOnAtttribute = addonType.GetCustomAttributes(false);
            var attribute            = csLuaAddOnAtttribute.OfType <CsLuaAddOnAttribute>().First();

            this.Name                       = attribute.Name;
            this.SavedVariables             = attribute.SavedVariables ?? new string[] { };
            this.SavedVariablesPerCharacter = attribute.SavedVariablesPerCharacter ?? new string[] { };

            this.InsertTocValue("Name", this.Name);
            this.InsertTocValue("Title", attribute.Title);
            this.InsertTocValue("Author", attribute.Author);
            this.InsertTocValue("LoadOnDemand", attribute.LoadOnDemand);
            this.InsertTocValue("Notes", attribute.Notes);
            this.InsertTocValue("Version", attribute.Version);
        }
Exemplo n.º 2
0
 public SessionBuilder WithAddOn(ICsLuaAddOn addOn)
 {
     this.addOns.Add(new AddOn(addOn));
     return(this);
 }