コード例 #1
0
ファイル: ProtoOption.cs プロジェクト: peter-r-g/CryoFall
        protected ProtoOption()
        {
            this.category = GetProtoEntity <TProtoOptionsCategory>();
            this.category.RegisterOption(this);

            this.optionValueHolder = new OptionValueHolder(this, this.Default);
        }
コード例 #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);
 }