Changeset - 57e33102e42b
[Not reviewed]
default
0 1 0
Jason Maltzen - 3 years ago 2021-09-10 00:00:11
jason@hiddenachievement.com
During recipe generation, don't allow min concentration to go be set below 10 or max reagents below 1
1 file changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
Models/RecipeSearchNode.cs
Show inline comments
...
 
@@ -8,17 +8,26 @@ namespace DesertPaintCodex.Models
 
    public class RecipeSearchNode
 
    {
 
        private readonly uint[] _reagents;
 
        private readonly uint _invalidReagent;
 

	
 
        private int _nextReagentPos;
 
        public int ReagentCount => _nextReagentPos;
 

	
 
        public uint MinConcentration { get; set; } = 10;
 
        private uint _minConcentration = 10;
 
        public uint MinConcentration
 
        {
 
            get => _minConcentration;
 
            set
 
            {
 
                if (value < 10) value = 10;
 
                _minConcentration = value;
 
            }
 
        }
 

	
 
        private readonly bool[] _reagentInUse;
 
        private readonly List<Reagent> _costSortedReagents;
 
        public PaintRecipe? TestRecipe { get; set; }
 

	
 
        public uint CurrentTargetQuantity { get; set; }
 
        public uint MaxConcentration { get; set; }
 
        public uint UsedQuantity { get; private set; }
...
 
@@ -32,16 +41,17 @@ namespace DesertPaintCodex.Models
 
        public Action<string>? WriteLog = null;
 

	
 
        private uint _maxReagents;
 
        public uint MaxReagents
 
        {
 
            get => _maxReagents;
 
            set
 
            {
 
                if (value < 1) value = 1;
 
                _maxReagents = value;
 
                CurrentWeights = new uint[_maxReagents];
 
            }
 
        }
 

	
 
        public uint[] CurrentWeights { get; private set; }
 
        
 
        public uint LastReagent => _reagents[_nextReagentPos - 1];
0 comments (0 inline, 0 general)