Changed method names.
This commit is contained in:
@@ -25,14 +25,14 @@ namespace GameServiceWarden.Core.Games
|
||||
IReadOnlyDictionary<string, IGameServiceModule> assemblyModules = this.modules[assemblyName];
|
||||
if (services.ContainsKey(serviceName)) throw new ArgumentException($"Service of Name \"{serviceName}\" already exists.");
|
||||
|
||||
services.Add(serviceName, new GameServiceInfo(assemblyModules[moduleName].InstantiateGameService(services.GetPathForKey(serviceName), true), moduleName, assemblyName));
|
||||
services.AddToPersistence(serviceName, new GameServiceInfo(assemblyModules[moduleName].InstantiateGameService(services.GetPathForKey(serviceName), true), moduleName, assemblyName));
|
||||
}
|
||||
|
||||
public void DeleteService(string serviceName)
|
||||
{
|
||||
if (!services.ContainsKey(serviceName)) throw new KeyNotFoundException($"Service under name \"{serviceName}\" not found.");
|
||||
if (services[serviceName].GetServiceState() == ServiceState.Running) services[serviceName].Stop();
|
||||
services.Remove(serviceName);
|
||||
services.Delete(serviceName);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetModuleNames()
|
||||
|
@@ -106,7 +106,7 @@ namespace GameServiceWarden.Core.Persistence
|
||||
return mapDirectory + Path.DirectorySeparatorChar + key;
|
||||
}
|
||||
|
||||
public bool TryGetValue(string key, [MaybeNullWhen(false)] out IReadOnlyDictionary<string, IGameServiceModule> value)
|
||||
public bool TryLoadValue(string key, [MaybeNullWhen(false)] out IReadOnlyDictionary<string, IGameServiceModule> value)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -7,8 +7,8 @@ namespace GameServiceWarden.Core.Persistence
|
||||
{
|
||||
new V this[string key] { get; set; }
|
||||
|
||||
void Add(string key, V value);
|
||||
void AddToPersistence(string key, V value);
|
||||
void Clear();
|
||||
bool Remove(string key);
|
||||
bool Delete(string key);
|
||||
}
|
||||
}
|
@@ -24,6 +24,6 @@ namespace GameServiceWarden.Core.Persistence
|
||||
/// <param name="key">The key to get the path for.</param>
|
||||
/// <returns>A <see cref="string"/> representing the key.</returns>
|
||||
string GetPathForKey(string key);
|
||||
bool TryGetValue(string key, [MaybeNullWhen(false)] out V value);
|
||||
bool TryLoadValue(string key, [MaybeNullWhen(false)] out V value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user