Add() public method

public Add ( string carId, string rulesSetId, string hashValue ) : void
carId string
rulesSetId string
hashValue string
return void
Esempio n. 1
0
        private HashStorage CreateNew([NotNull] RulesEntry[] rulesSet, string[] carIds)
        {
            var hashStorage = new HashStorage(_rulesKeys);

            foreach (var car in carIds)
            {
                var carLocation = FileUtils.GetCarDirectory(_acRoot, car);
                if (!Directory.Exists(carLocation))
                {
                    continue;
                }

                var carData = DataWrapper.FromCarDirectory(carLocation);
                var bytes   = new byte[rulesSet.Length][];
                for (var i = 0; i < rulesSet.Length; i++)
                {
                    var set = rulesSet[i];
                    bytes[i] = set.Rules.GetHash(carData);
                }

                hashStorage.Add(car, bytes);
            }

            hashStorage.ParamsHashCode = _paramsHashCode;
            hashStorage.SaveTo(_storageLocation);
            return(hashStorage);
        }