예제 #1
0
        public ResourceOrder MakeOrder(double amount, Company orderCompany)
        {
            ResourceOrder order = new ResourceOrder(this, orderCompany, price, 10, amount);

            //orders.Add(order);
            orderCompany.resourceOrders.Add(order);
            return(order);
        }
예제 #2
0
        private void PayOrder(ResourceOrder order, ref double totalPrice, ref double amountBought)
        {
            double amount = order.sale.amount > order.amount ? order.amount : order.sale.amount;

            order.sale.soldThisTick += amount;
            totalPrice        += amount * order.price;
            order.sale.amount -= amount;
            amountBought      += amount;
            TransportationCosts(order.sale.company, amount);
            order.timeLeft--;
        }