Exemple #1
0
        private void ProcessSinglePurchase(BuyItemResponse buy, IBuyItemInfo bii, List <BuyItemResponse> validBuy, ref int controlSlots, ref bool fullPurchase, ref int totalCost)
        {
            int amount = buy.Amount;

            if (amount > bii.Amount)
            {
                amount = bii.Amount;
            }

            if (amount <= 0)
            {
                return;
            }

            int slots = bii.ControlSlots * amount;

            if (controlSlots >= slots)
            {
                controlSlots -= slots;
            }
            else
            {
                fullPurchase = false;
                return;
            }

            totalCost += bii.Price * amount;
            validBuy.Add(buy);
        }
        private void ProcessSinglePurchase(BuyItemResponse buy, IBuyItemInfo bii, List <BuyItemResponse> validBuy,
                                           ref bool fullPurchase, ref int totalCost)
        {
            int amount = buy.Amount;

            if (amount > bii.Amount)
            {
                amount = bii.Amount;
            }

            if (amount <= 0)
            {
                return;
            }

            totalCost += bii.Price * amount;
            validBuy.Add(buy);
        }
		private void ProcessSinglePurchase(
			BuyItemResponse buy,
			IBuyItemInfo bii,
			ICollection<BuyItemResponse> validBuy,
			ref int controlSlots,
			ref bool fullPurchase,
			ref int totalCost)
		{
			if (!Trading || TokenType == null || !TokenType.IsNotNull)
			{
				return;
			}

			int amount = buy.Amount;

			if (amount > bii.Amount)
			{
				amount = bii.Amount;
			}

			if (amount <= 0)
			{
				return;
			}

			int slots = bii.ControlSlots * amount;

			if (controlSlots >= slots)
			{
				controlSlots -= slots;
			}
			else
			{
				fullPurchase = false;
				return;
			}

			totalCost += bii.Price * amount;
			validBuy.Add(buy);
		}
Exemple #4
0
		private void ProcessSinglePurchase( BuyItemResponse buy, IBuyItemInfo bii, List<BuyItemResponse> validBuy, ref int controlSlots, ref bool fullPurchase, ref int totalCost )
		{
			int amount = buy.Amount;

			if ( amount > bii.Amount )
				amount = bii.Amount;

			if ( amount <= 0 )
				return;

			int slots = bii.ControlSlots * amount;

			if ( controlSlots >= slots )
			{
				controlSlots -= slots;
			}
			else
			{
				fullPurchase = false;
				return;
			}

			totalCost += bii.Price * amount;
			validBuy.Add( buy );
		}