public int?GetOrder(ToggleableModProxy mod) { var name = mod.GetSerializationString().ToLower(); return(Orders.ContainsKey(name) ? (int?)Orders[name] : null); }
void MakeRequired(ToggleableModProxy mod) { var serializationString = mod.GetSerializationString(); RequiredMods.AddWhenMissing(serializationString); OptionalMods.RemoveLocked(serializationString); mod.IsRequired = true; }
public Dependency GetDesiredModVersion(ToggleableModProxy mod) { var name = mod.GetSerializationString().ToLower(); return(Versions.ContainsKey(name) ? new Dependency(name, Versions[name]) : new GlobalDependency(name)); }
public void SetRequired(ToggleableModProxy toggleableModProxy, bool b) { if (b) { MakeRequired(toggleableModProxy); } else { MakeUnrequired(toggleableModProxy); } }
static CollectionVersionDependencyModel Convert(ToggleableModProxy x) => new CollectionVersionDependencyModel { Dependency = x.Name, Constraint = x.GetDesiredOrGlobal(), IsRequired = x.IsRequired };