Exemplo n.º 1
0
        /// <summary>
        /// Metoda, która umożliwia zwiększenie przyrostu zasobu na tick zegara, wyrażonego w procentach.
        /// </summary>
        /// <param name="percentage">Parametr, określający bonus wyrażony w procentach.</param>
        /// <param name="time">Paramter, określający czas trwania aktywności bonusa.</param>
        public void AddBonusPercentage(double percentage, int time)
        {
            CurrentIncreaseQuantity += percentage / 100 * beginningIncreaseQuantity;

            TickAction action = new TickAction(time);

            action.Actions += () => { CurrentIncreaseQuantity -= percentage * beginningIncreaseQuantity; };

            GameEngine.ActionList.AddAction(action);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Metoda, która umożliwia zwiększanie przyrostu zasobu na tick zegara, wyrażonego liczbą.
        /// </summary>
        /// <param name="quantity">Paramter, określający bonus wyrażone w liczbie jednostek danego zasobu.</param>
        /// <param name="time">Paramter, określający czas trwania aktywności bonusa.</param>
        public void AddBonusQuantity(double quantity, int time)
        {
            if (time == 0)
            {
                CurrentIncreaseQuantity += quantity;
                return;
            }

            CurrentIncreaseQuantity += quantity;

            TickAction action = new TickAction(time);

            action.Actions += () => { CurrentIncreaseQuantity -= quantity; };

            GameEngine.ActionList.AddAction(action);
        }