示例#1
0
        public void Decrement(int stratumId, int?secondaryStratumId, int?tertiaryStratumId)
        {
            AccumulatedProportion ap = this.m_Map.GetItemExact(stratumId, secondaryStratumId, tertiaryStratumId);

            ap.Amount -= this.m_Amount;

            if (ap.Amount < 0.0)
            {
                ap.Amount = 0.0;
            }
        }
示例#2
0
        public object GetValue(int stratumId, int?secondaryStratumId, int?tertiaryStratumId)
        {
            AccumulatedProportion ap = this.m_Map.GetItemExact(stratumId, secondaryStratumId, tertiaryStratumId);

            if (ap == null)
            {
                return(null);
            }
            else
            {
                return(ap.Amount);
            }
        }
示例#3
0
        public void AddOrIncrement(int stratumId, int?secondaryStratumId, int?tertiaryStratumId)
        {
            AccumulatedProportion ap = this.m_Map.GetItemExact(stratumId, secondaryStratumId, tertiaryStratumId);

            if (ap == null)
            {
                this.m_Map.AddItem(stratumId, secondaryStratumId, tertiaryStratumId, new AccumulatedProportion(this.m_Amount));
            }
            else
            {
                Debug.Assert(ap.Amount >= this.m_Amount);
                ap.Amount += this.m_Amount;
            }
        }