From 022635334674c8515478ac1e549fafea3b626ef3 Mon Sep 17 00:00:00 2001 From: cadon Date: Sat, 12 Jun 2021 16:54:15 +0200 Subject: [PATCH] added support for the noGender property --- ARKBreedingStats/BreedingPlanning/BreedingPlan.cs | 2 +- ARKBreedingStats/BreedingPlanning/BreedingScore.cs | 5 +++-- ARKBreedingStats/Form1.values.cs | 3 +-- ARKBreedingStats/species/Species.cs | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ARKBreedingStats/BreedingPlanning/BreedingPlan.cs b/ARKBreedingStats/BreedingPlanning/BreedingPlan.cs index ad137b87..4a30f1e7 100644 --- a/ARKBreedingStats/BreedingPlanning/BreedingPlan.cs +++ b/ARKBreedingStats/BreedingPlanning/BreedingPlan.cs @@ -339,7 +339,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs() var combinedCreatures = new List(selectedFemales); combinedCreatures.AddRange(selectedMales); - if (Settings.Default.IgnoreSexInBreedingPlan) + if (Settings.Default.IgnoreSexInBreedingPlan || _currentSpecies.noGender) { selectedFemales = combinedCreatures.ToArray(); selectedMales = combinedCreatures.ToArray(); diff --git a/ARKBreedingStats/BreedingPlanning/BreedingScore.cs b/ARKBreedingStats/BreedingPlanning/BreedingScore.cs index 0379743b..80cb6f75 100644 --- a/ARKBreedingStats/BreedingPlanning/BreedingScore.cs +++ b/ARKBreedingStats/BreedingPlanning/BreedingScore.cs @@ -19,15 +19,16 @@ public static List CalculateBreedingScores(Creature[] females, Cre ref bool creaturesMutationsFilteredOut) { var breedingPairs = new List(); + var ignoreSex = Properties.Settings.Default.IgnoreSexInBreedingPlan || species.noGender; for (int fi = 0; fi < females.Length; fi++) { var female = females[fi]; for (int mi = 0; mi < males.Length; mi++) { var male = males[mi]; - // if Properties.Settings.Default.IgnoreSexInBreedingPlan (useful when using S+ mutator), skip pair if + // if ignoreSex (useful when using S+ mutator), skip pair if // creatures are the same, or pair has already been added - if (Settings.Default.IgnoreSexInBreedingPlan) + if (ignoreSex) { if (considerChosenCreature) { diff --git a/ARKBreedingStats/Form1.values.cs b/ARKBreedingStats/Form1.values.cs index a15ecd1c..261ab98c 100644 --- a/ARKBreedingStats/Form1.values.cs +++ b/ARKBreedingStats/Form1.values.cs @@ -7,7 +7,6 @@ using System.IO; using System.Linq; using System.Runtime.Serialization; -using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ARKBreedingStats.utils; @@ -208,7 +207,7 @@ private bool LoadStatValues(Values values) _ = Task.Run(async () => await LoadModsManifestAsync(values)); if (values.serverMultipliersPresets == null) LoadServerMultiplierPresets(values); - + success = true; } catch (DirectoryNotFoundException) diff --git a/ARKBreedingStats/species/Species.cs b/ARKBreedingStats/species/Species.cs index f81c9794..fc3b2ea2 100644 --- a/ARKBreedingStats/species/Species.cs +++ b/ARKBreedingStats/species/Species.cs @@ -91,6 +91,11 @@ public class Species public TamingData taming; [JsonProperty] public BreedingData breeding; + /// + /// If the species uses no gender, ignore the sex in the breeding planner. + /// + [JsonProperty] + public bool noGender; [JsonProperty] public Dictionary boneDamageAdjusters; [JsonProperty]