コード例 #1
0
 public ResultNodeViewModel(
     ModifierNodeViewModelFactory modifierNodeFactory, IStat stat, NodeType nodeType = NodeType.Total)
     : base(stat, nodeType)
 {
     _modifierNodeFactory = modifierNodeFactory;
     _modifierNodes       = CreateModifierNodes();
 }
コード例 #2
0
 public ResultStatsViewModel(
     CalculationNodeViewModelFactory nodeFactory, ModifierNodeViewModelFactory modifierNodeFactory)
 {
     _nodeFactory         = nodeFactory;
     _modifierNodeFactory = modifierNodeFactory;
     NewStat        = new AddableResultStatViewModel();
     AddStatCommand = new RelayCommand(AddStat);
 }
コード例 #3
0
        private ComputationViewModel(ObservableCalculator observableCalculator, ComputationSchedulerProvider schedulers)
        {
            _observableCalculator = observableCalculator;
            _nodeFactory          = new CalculationNodeViewModelFactory(observableCalculator, schedulers.Dispatcher);
            var modifierNodeFactory = new ModifierNodeViewModelFactory(observableCalculator, _nodeFactory);

            OffensiveStats = new ResultStatsViewModel(_nodeFactory, modifierNodeFactory);
            DefensiveStats = new ResultStatsViewModel(_nodeFactory, modifierNodeFactory);
        }
コード例 #4
0
 public ResultStatViewModel(
     ResultNodeViewModel node, ModifierNodeViewModelFactory modifierNodeFactory,
     Action <ResultStatViewModel> removeAction)
 {
     _modifierNodeFactory = modifierNodeFactory;
     Node = node;
     Node.PropertyChanged += NodeOnPropertyChanged;
     RemoveCommand         = new RelayCommand(() => removeAction(this));
     ResetModifierNodes();
 }
コード例 #5
0
 public CalculationNodeViewModelFactory(
     ModifierNodeViewModelFactory modifierNodeFactory,
     ObservableCalculator calculator, IScheduler observerScheduler)
 => (_modifierNodeFactory, _calculator, _observerScheduler) =