protected ProtoOption() { this.category = GetProtoEntity <TProtoOptionsCategory>(); this.category.RegisterOption(this); this.optionValueHolder = new OptionValueHolder(this, this.Default); }
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); }