public bool Compatible(KspVersion gameVersion, CkanModule module) { // If it's strictly compatible, then it's compatible. if (strict.Compatible(gameVersion, module)) { return(true); } // If we're in strict mode, and it's not strictly compatible, then it's // not compatible. if (module.ksp_version_strict) { return(false); } // Otherwise, check if it's "generally recognise as safe". // If we're running KSP 1.0.4, then allow the mod to run if we would have // considered it compatible under 1.0.3 (as 1.0.4 was "just a hotfix"). if (gameVersion.Equals(KspVersion.Parse("1.0.4"))) { return(strict.Compatible(v103, module)); } return(false); }
public void TestStrictGameComparator(String modVersion, String gameVersion, bool expectedResult) { var comparator = new CKAN.StrictGameComparator(); // We're going to tweak compatibly of the mod gameMod.ksp_version = GameVersion.Parse(modVersion); // Now test! Assert.AreEqual(expectedResult, comparator.Compatible(new GameVersionCriteria(GameVersion.Parse(gameVersion)), gameMod)); }
public void TestStrictGameComparatorMinMax(String modMinVersion, String modMaxVersion, String gameVersion, bool expectedResult) { var comparator = new CKAN.StrictGameComparator(); gameMod.ksp_version = null; gameMod.ksp_version_min = modMinVersion == null ? null : GameVersion.Parse(modMinVersion); gameMod.ksp_version_max = modMaxVersion == null ? null : GameVersion.Parse(modMaxVersion); // Now test! Assert.AreEqual(expectedResult, comparator.Compatible(new GameVersionCriteria(GameVersion.Parse(gameVersion)), gameMod)); }
public bool Compatible(FactorioVersion gameVersion, CfanModule module) { // If it's strictly compatible, then it's compatible. if (strict.Compatible(gameVersion, module)) { return(true); } // if we will add something like "maximum game version" for a mod, then it might make sense to add something here (see summary of the class) return(false); }
public override bool Compatible(KspVersionCriteria gameVersionCriteria, CkanModule module) { // If it's strictly compatible, then it's compatible. if (strict.Compatible(gameVersionCriteria, module)) { return(true); } // If we're in strict mode, and it's not strictly compatible, then it's // not compatible. if (module.ksp_version_strict) { return(false); } return(base.Compatible(gameVersionCriteria, module)); }
public override bool Compatible(KspVersionCriteria gameVersionCriteria, CkanModule module) { // If it's strictly compatible, then it's compatible. if (strict.Compatible(gameVersionCriteria, module)) { return(true); } bool isExempt = _gameComparatorExemptions.IsExempt(module); // If we're in strict mode, and it's not strictly compatible, then it's // not compatible. if (module.ksp_version_strict) { return(false || isExempt); } return(base.Compatible(gameVersionCriteria, module) || isExempt); }