Exemplo n.º 1
0
        public void OnHeroGoldCoinChanged(ref PoolObjHandle <ActorRoot> InActor, int InChangedValue, int InCurrentValue, bool bInIsIncome)
        {
            byte actorCamp = (byte)InActor.handle.TheActorMeta.ActorCamp;

            if (actorCamp < this.CampGolds.Length)
            {
                CampData data1 = this.CampGolds[actorCamp];
                data1.Golds += InChangedValue;
                this.RefreshFlags(actorCamp);
            }
        }
Exemplo n.º 2
0
        private void RefreshFlags(byte InChangedIndex)
        {
            CampData campData = this.CampGolds[(int)InChangedIndex];

            for (int i = 0; i < this.CampGolds.Length; i++)
            {
                if ((int)InChangedIndex != i)
                {
                    CampData campData2 = this.CampGolds[i];
                    int      num       = campData.Golds - campData2.Golds;
                    if (num < 0 && num < campData.NegativeGolds[i])
                    {
                        campData.NegativeGolds[i] = num;
                        campData2.PositiveGolds[(int)InChangedIndex] = num * -1;
                    }
                    else if (num > 0 && num > campData.PositiveGolds[i])
                    {
                        campData.PositiveGolds[i] = num;
                        campData2.NegativeGolds[(int)InChangedIndex] = num * -1;
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void RefreshFlags(byte InChangedIndex)
        {
            CampData data = this.CampGolds[InChangedIndex];

            for (int i = 0; i < this.CampGolds.Length; i++)
            {
                if (InChangedIndex != i)
                {
                    CampData data2 = this.CampGolds[i];
                    int      num2  = data.Golds - data2.Golds;
                    if ((num2 < 0) && (num2 < data.NegativeGolds[i]))
                    {
                        data.NegativeGolds[i] = num2;
                        data2.PositiveGolds[InChangedIndex] = num2 * -1;
                    }
                    else if ((num2 > 0) && (num2 > data.PositiveGolds[i]))
                    {
                        data.PositiveGolds[i] = num2;
                        data2.NegativeGolds[InChangedIndex] = num2 * -1;
                    }
                }
            }
        }