Exemplo n.º 1
0
        protected virtual void TickInner(Actor self, bool allProductionPaused)
        {
            while (queue.Count > 0 && BuildableItems().All(b => b.Name != queue[0].Item))
            {
                // Refund what's been paid so far
                playerResources.GiveCash(queue[0].TotalCost - queue[0].RemainingCost);
                FinishProduction();
            }

            if (queue.Count > 0 && !allProductionPaused)
            {
                queue[0].Tick(playerResources);
            }
        }
Exemplo n.º 2
0
        public void GiveResource(int amount)
        {
            if (info.UseStorage)
            {
                if (info.DiscardExcessResources)
                {
                    amount = Math.Min(amount, playerResources.ResourceCapacity - playerResources.Resources);
                }

                playerResources.GiveResources(amount);
            }
            else
            {
                playerResources.GiveCash(amount);
            }

            if (info.ShowTicks)
            {
                currentDisplayValue += amount;
            }
        }