public ConfigurationStatViewModel( ConfigurationNodeViewModel node, ResultNodeViewModel?minimumNode = null, ResultNodeViewModel?maximumNode = null) { Node = node; MinimumNode = minimumNode; MaximumNode = maximumNode; }
private void SetNodeValue(ConfigurationNodeViewModel node) { using (_setNodeValueMonitor.Enter()) { if (ConfigurationStats.TryGetValue(node.Stat, out var value)) { node.Value = value; } else { node.ResetValue(); } } }
public void ListensToNodeValueChanges() { var stat = new Stat("a"); var expected = new NodeValue(42); var build = new PoEBuild(); var node = new ConfigurationNodeViewModel(stat); SetupSut(build, node); node.Value = expected; Assert.IsTrue(build.ConfigurationStats.TryGetValue(stat, out var actual)); Assert.AreEqual(expected, actual); }
private MainSkillSelectionViewModel( SkillDefinitions skillDefinitions, IBuilderFactories builderFactories, CalculationNodeViewModelFactory nodeFactory) { _skillDefinitions = skillDefinitions; var selectedSkillItemSlotStat = builderFactories.MetaStatBuilders.MainSkillItemSlot .BuildToStats(Entity.Character).Single(); _selectedSkillItemSlot = nodeFactory.CreateConfiguration(selectedSkillItemSlotStat, new NodeValue(0)); var selectedSkillSocketIndexStat = builderFactories.MetaStatBuilders.MainSkillSocketIndex .BuildToStats(Entity.Character).Single(); _selectedSkillSocketIndex = nodeFactory.CreateConfiguration(selectedSkillSocketIndexStat, new NodeValue(0)); var selectedSkillPartStat = builderFactories.StatBuilders.MainSkillPart .BuildToStats(Entity.Character).Single(); _selectedSkillPart = nodeFactory.CreateConfiguration(selectedSkillPartStat, new NodeValue(0)); ConfigurationNodes = new[] { _selectedSkillItemSlot, _selectedSkillSocketIndex, _selectedSkillPart }; }
public MainSkillViewModel( SkillDefinition skillDefinition, Skill skill, ConfigurationNodeViewModel selectedSkillPart) => (SkillDefinition, Skill, SelectedSkillPart) =