Example #1
0
        internal InCome(string name, double percent, ObservableValue <double> maxValue) : this()
        {
            this.name     = name;
            this.percent  = new SubjectValue <double>(percent);
            this.maxValue = maxValue;

            InitObservableData(new StreamingContext());
        }
Example #2
0
        internal Output(string name, double percent, ObservableValue <double> maxValue, Action expend = null) : this()
        {
            this.name     = name;
            this.percent  = new SubjectValue <double>(percent);
            this.maxValue = maxValue;
            this.expend   = expend;

            InitObservableData(new StreamingContext());
        }
Example #3
0
        internal void InitObservableData(StreamingContext context)
        {
            popNum = Observable.CombineLatest(pops.Where(x => x.def.is_collect_tax).Select(x => x.num.obs),
                                              (IList <double> nums) => nums.Sum(y => (int)y)).ToOBSValue();

            tax = Observable.CombineLatest(pops.Select(x => x.tax.value.obs),
                                           (IList <double> nums) => nums.Sum()).ToOBSValue();

            adminExpendBase = Observable.CombineLatest(pops.Select(x => x.adminExpend.value.obs),
                                                       (IList <double> nums) => nums.Sum()).ToOBSValue();
        }
Example #4
0
 private void InitObservableData(StreamingContext context)
 {
     monthSurplus = Observable.CombineLatest(incomes.total.obs, outputs.total.obs, (i, o) => i - o).ToOBSValue();
 }
Example #5
0
 private void InitObservableData(StreamingContext context)
 {
     this.currValue = Observable.CombineLatest(this.percent.obs, maxValue.obs, (p, m) => p * m / 100).ToOBSValue();
 }
Example #6
0
 private void InitObservableData(StreamingContext context)
 {
     total = Observable.CombineLatest(Output.all.Select(x => x.currValue.obs), (IList <double> all) => all.Sum()).ToOBSValue();
 }
Example #7
0
 private void InitObservableData(StreamingContext context)
 {
     expectMonthTaxValue = Observable.CombineLatest(reportPopNum.obs, reportTaxPercent.obs,
                                                    (x, y) => x * 0.006 * y / 100)
                           .ToOBSValue();
 }