chore: convert movement regime kinds to enum
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
using SpaceGame.Api.Shared.Runtime;
|
||||
|
||||
namespace SpaceGame.Api.Universe.Scenario;
|
||||
|
||||
internal static class LoaderSupport
|
||||
@@ -124,6 +126,14 @@ internal static class LoaderSupport
|
||||
internal static int CountModules(IEnumerable<string> modules, string moduleId) =>
|
||||
modules.Count(candidate => string.Equals(candidate, moduleId, StringComparison.Ordinal));
|
||||
|
||||
internal static int CountModules(
|
||||
IEnumerable<string> modules,
|
||||
IReadOnlyDictionary<string, ModuleDefinition> moduleDefinitions,
|
||||
ModuleType moduleType) =>
|
||||
modules.Count(moduleId =>
|
||||
moduleDefinitions.TryGetValue(moduleId, out var definition)
|
||||
&& definition.ModuleType == moduleType);
|
||||
|
||||
internal static float ComputeWorkforceRatio(float population, float workforceRequired)
|
||||
{
|
||||
if (workforceRequired <= 0.01f)
|
||||
|
||||
Reference in New Issue
Block a user