Esempio n. 1
0
 protected void InheritProperties(IBotSetting BaseSetting)
 {
     this.Identifier      = BaseSetting.Identifier;
     this.Description     = BaseSetting.Description;
     this.ValueTypeString = BaseSetting.ValueTypeString;
     this.DefaultValueStr = BaseSetting.DefaultValueStr;
 }
Esempio n. 2
0
            public GuildBotSetting(IBotSetting BaseSetting, IUserMessage _Message)
            {
                InheritProperties(BaseSetting);
                Message = _Message;

                _AllSettings.Add(this);
                _SettingMessageIds.Add(_Message.Id);
            }
Esempio n. 3
0
            // Simple subroutine for absorbing a base setting and taking its common properties.
            // Not appropriate for a cast since an IBotSetting requires additional data to be turned into this
            // (i.e. a Message object)


            // constructor from setting
            // (can't define casts with interfaces or base classes)
            public GuildBotSettingYN(IBotSetting BaseSetting, IUserMessage _Message) : base(BaseSetting, _Message)
            {
                if (BaseSetting.ValueType != ValueData.Bool)
                {
                    throw new ArgumentException("Attempted to create a bool setting from an IBotSetting which wasn't of the right type");
                }

                // Base constructor does pretty much everything
            }