Esempio n. 1
0
        protected ProtoOption()
        {
            this.category = GetProtoEntity <TProtoOptionsCategory>();
            this.category.RegisterOption(this);

            this.optionValueHolder = new OptionValueHolder(this, this.Default);
        }
Esempio n. 2
0
 public OptionEntityList(
     ProtoSettings parentSettings,
     string id,
     IEnumerable <IProtoEntity> entityList,
     List <string> defaultEnabledList,
     Action <List <IProtoEntity> > onEnabledListChanged)
 {
     this.parentSettings = parentSettings;
     Id = id;
     this.defaultEnabledList = defaultEnabledList;
     EntityDictionary        = new Dictionary <IProtoEntity, bool>();
     foreach (var entity in entityList)
     {
         EntityDictionary[entity] = (defaultEnabledList?.Count > 0) && defaultEnabledList.Contains(entity.Id);
     }
     OnEnabledListChanged = onEnabledListChanged;
     optionValueHolder    = new OptionValueHolder(this, EntityDictionary);
 }