tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
CommandFactory.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
10
12{
15 {
20
25
30
35
40
45
50
66 Models.Instance instance)
67 {
68 this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
69 this.engineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
70 this.repositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
71 this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory));
72 this.compileJobProvider = compileJobProvider ?? throw new ArgumentNullException(nameof(compileJobProvider));
73 this.instance = instance ?? throw new ArgumentNullException(nameof(instance));
74 }
75
81 {
82 if (this.watchdog != null)
83 throw new InvalidOperationException("SetWatchdog has already been called!");
84 this.watchdog = watchdog ?? throw new ArgumentNullException(nameof(watchdog));
85 }
86
88 public IReadOnlyList<ICommand> GenerateCommands()
89 {
90 if (watchdog == null)
91 throw new InvalidOperationException("SetWatchdog has not been called!");
92 return new List<ICommand>
93 {
98 new KekCommand(),
99 };
100 }
101 }
102}
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the CommandFactory.
readonly Models.Instance instance
The Models.Instance for the CommandFactory.
readonly ILatestCompileJobProvider compileJobProvider
The ILatestCompileJobProvider for the CommandFactory.
void SetWatchdog(IWatchdog watchdog)
Set a watchdog for the CommandFactory.
CommandFactory(IAssemblyInformationProvider assemblyInformationProvider, IEngineManager engineManager, IRepositoryManager repositoryManager, IDatabaseContextFactory databaseContextFactory, ILatestCompileJobProvider compileJobProvider, Models.Instance instance)
Initializes a new instance of the CommandFactory class.
readonly IEngineManager engineManager
The IEngineManager for the CommandFactory.
readonly IDatabaseContextFactory databaseContextFactory
The IDatabaseContextFactory for the CommandFactory.
readonly IRepositoryManager repositoryManager
The IRepositoryManager for the CommandFactory.
IWatchdog? watchdog
The IWatchdog for the CommandFactory.
IReadOnlyList< ICommand > GenerateCommands()
Generate builtin ICommands.A IReadOnlyList<T> of ICommands.
For displaying the installed Byond version.
For displaying Api.Models.Internal.RevisionInformation.
ICommand to return the IAssemblyInformationProvider.VersionString.
Represents an Api.Models.Instance in the database.
Definition Instance.cs:11
Runs and monitors the twin server controllers.
Definition IWatchdog.cs:16
Factory for scoping usage of IDatabaseContexts. Meant for use by Components.