Skip to content

Commit

Permalink
added support for the noGender property
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Jun 12, 2021
1 parent 4891f83 commit 0226353
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/BreedingPlanning/BreedingPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private void DoCalculateBreedingScoresAndDisplayPairs()
var combinedCreatures = new List<Creature>(selectedFemales);
combinedCreatures.AddRange(selectedMales);

if (Settings.Default.IgnoreSexInBreedingPlan)
if (Settings.Default.IgnoreSexInBreedingPlan || _currentSpecies.noGender)
{
selectedFemales = combinedCreatures.ToArray();
selectedMales = combinedCreatures.ToArray();
Expand Down
5 changes: 3 additions & 2 deletions ARKBreedingStats/BreedingPlanning/BreedingScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ public static List<BreedingPair> CalculateBreedingScores(Creature[] females, Cre
ref bool creaturesMutationsFilteredOut)
{
var breedingPairs = new List<BreedingPair>();
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)
{
Expand Down
3 changes: 1 addition & 2 deletions ARKBreedingStats/Form1.values.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions ARKBreedingStats/species/Species.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public class Species
public TamingData taming;
[JsonProperty]
public BreedingData breeding;
/// <summary>
/// If the species uses no gender, ignore the sex in the breeding planner.
/// </summary>
[JsonProperty]
public bool noGender;
[JsonProperty]
public Dictionary<string, double> boneDamageAdjusters;
[JsonProperty]
Expand Down

0 comments on commit 0226353

Please sign in to comment.