public Siren(Vehicle vehicle, Vcfroot vcfroot, [Optional] IDictionary <string, object> data, IPatterns patt) { _vcf = vcfroot; _vehicle = vehicle; _patternController = patt; Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, _vehicle, true); Utils.DebugWriteLine(_vehicle.DisplayName); _tones = new Tones { horn = new Tone(vcfroot.SOUNDS.MainHorn.AudioString, _vehicle, ToneType.Horn, true), tone1 = new Tone(vcfroot.SOUNDS.SrnTone1.AudioString, _vehicle, ToneType.SrnTon1, vcfroot.SOUNDS.SrnTone1.AllowUse), tone2 = new Tone(vcfroot.SOUNDS.SrnTone2.AudioString, _vehicle, ToneType.SrnTon2, vcfroot.SOUNDS.SrnTone2.AllowUse), tone3 = new Tone(vcfroot.SOUNDS.SrnTone3.AudioString, _vehicle, ToneType.SrnTon3, vcfroot.SOUNDS.SrnTone3.AllowUse), tone4 = new Tone(vcfroot.SOUNDS.SrnTone4.AudioString, _vehicle, ToneType.SrnTon4, vcfroot.SOUNDS.SrnTone4.AllowUse), panicAlarm = new Tone(vcfroot.SOUNDS.PanicMde.AudioString, _vehicle, ToneType.SrnPnic, vcfroot.SOUNDS.PanicMde.AllowUse) }; dual_siren = false; _mainSiren = new MainSiren(ref _tones); if (data != null) { SetData(data); } ElsUiPanel.SetUiDesc(_mainSiren.currentTone.Type, "SRN"); ElsUiPanel.SetUiDesc("--", "HRN"); }
public void builder() { _filesystem = Substitute.For<IFileSystem>(); _filesystem.GetPlatformRoot().Returns(The.Root); _filesystem.Exists(null).ReturnsForAnyArgs(true); _modules = Substitute.For<IModules>(); _modules.Paths.Returns(new[] { "group1/proj1", "group1/proj2", "group2/proj3" }); _modules.Repos.Returns(new[] { "p1Repo", "p2Repo", "p3Repo" }); _locks = new List<AutoResetEvent> { new AutoResetEvent(true), new AutoResetEvent(true), new AutoResetEvent(true) }; _modules.CreateAndSetLocks().Returns(_locks); _patterns = new Patterns { DependencyPattern = "*.dll", DependencyPath = (FilePath)"lib", Masters = new FilePath[] { } }; _git = Substitute.For<IGit>(); _depMgr = Substitute.For<IDependencyManager>(); _ruleFac = Substitute.For<IRuleFactory>(); _ruleFac.GetModules().Returns(_modules); _ruleFac.GetRulePatterns().Returns(_patterns); _buildCmd = Substitute.For<IBuildCmd>(); _subject = new Builder(_filesystem, _git, _depMgr, _ruleFac, _buildCmd); _subject.Prepare(); _subject.GetDependenciesAndBuild(); }
public Siren(ELSVehicle vehicle, Vcfroot vcfroot, IPatterns patt) { _vcf = vcfroot; if (_vcf is null) { Utils.ReleaseWriteLine($"VCF for vehicle {vehicle?.Vehicle?.DisplayName} with netId {vehicle?.NetworkId} is null!"); return; } _elsVehicle = vehicle; _patternController = patt; Utils.DebugWriteLine($"{_vcf.SOUNDS.MainHorn.AudioString}"); Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone1.AudioString}"); Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone2.AudioString}"); Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone3.AudioString}"); Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone4.AudioString}"); _tones = new Tones { horn = new Tone(_vcf.SOUNDS.MainHorn.AudioString, _elsVehicle, ToneType.Horn, true, soundSet: _vcf.SOUNDS.MainHorn.SoundSet), tone1 = new Tone(_vcf.SOUNDS.SrnTone1.AudioString, _elsVehicle, ToneType.SrnTon1, _vcf.SOUNDS.SrnTone1.AllowUse, soundSet: _vcf.SOUNDS.SrnTone1.SoundSet), tone2 = new Tone(_vcf.SOUNDS.SrnTone2.AudioString, _elsVehicle, ToneType.SrnTon2, _vcf.SOUNDS.SrnTone2.AllowUse, soundSet: _vcf.SOUNDS.SrnTone2.SoundSet), tone3 = new Tone(_vcf.SOUNDS.SrnTone3.AudioString, _elsVehicle, ToneType.SrnTon3, _vcf.SOUNDS.SrnTone3.AllowUse, soundSet: _vcf.SOUNDS.SrnTone3.SoundSet), tone4 = new Tone(_vcf.SOUNDS.SrnTone4.AudioString, _elsVehicle, ToneType.SrnTon4, _vcf.SOUNDS.SrnTone4.AllowUse, soundSet: _vcf.SOUNDS.SrnTone4.SoundSet), }; _mainSiren = new MainSiren(ref _tones); dual_siren = false; ElsUiPanel.SetUiDesc(_mainSiren.MainTones[_mainSiren.currentTone].Type, "SRN"); ElsUiPanel.SetUiDesc("--", "HRN"); }
public DependencyManager(IPatterns patterns) { _patterns = patterns; _available = new Dictionary<string, FileInfo>(); // name => info _masters = new Dictionary<string, FileInfo>(); // name => info }
public Digit(int digit, IPatterns patterns) : this(digit, patterns.Of(digit)) { }
public void Prepare() { _rootPath = _files.GetPlatformRoot(); Log.Status("Started in " + _rootPath.ToEnvironmentalPath() + "; Updating self"); _git.PullMaster(_rootPath); _patterns = _rules.GetRulePatterns(); Modules = _rules.GetModules(); try { Modules.ReadDependencies(_rootPath); } catch (UnknownModuleException ex) { Log.Error(ex.Message + ", will pull all repositories. You will need to retry platform build."); _locks = Modules.CreateAndSetLocks(); PullRepos(); CloneMissingRepos(); throw; } Modules.SortInDependencyOrder(); _depMgr.ReadMasters(_rootPath, _patterns.Masters); DeleteOldPaths(); Log.Verbose("Processing " + string.Join(", ", Modules.Paths)); CloneMissingRepos(); _locks = Modules.CreateAndSetLocks(); }
public Modules(FilePath moduleRulePath, IFileSystem files, IPatterns patterns) { _moduleRulePath = moduleRulePath; _files = files; _patterns = patterns; }
public BuildCmd(IPatterns patterns, IFileSystem files) { _patterns = patterns; _files = files; }