ezet / evelib

Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and other popular Eve Online APIs.
Apache License 2.0
71 stars 36 forks source link

EveCentral: MarketCentral HourLimit/QuantityLimit Bug #43

Open ezet opened 9 years ago

ezet commented 9 years ago

Not sure what the problem is. I set either the region or the system (but not both) in the first Select Case, and all the BuyOrders and SellOrders values in response.Result.Item(0) are zero. Here's the code if that will help:

`` Public Function GetPrice(mat As cMaterial) As Double

    Dim options As New EveCentralOptions() With {.HourLimit = HourLimit, .MinQuantity = MinQuantity}
    options.Items.Add(mat.TypeID) 'add the material's type id 
    Dim EveCentral = New EveCentral()

    Select Case ItemType 'this is an enum value; value is property of this class

        Case eSystemType.REGION
            options.Regions.Add(ItemID)
        Case eSystemType.SOLARSYSTEM
            options.System = ItemID

    End Select

    Dim response As EveCentralModule.Models.MarketStatResponse = EveCentral.GetMarketStat(options)

    Select Case TypeTransaction ' this is an enum value; value is property of this class

        Case eTransaction.BUY

            Select Case TypePrice ' this is an enum value; value is property of this class

                Case ePrice.AVG
                    Return response.Result.Item(0).BuyOrders.Average
                Case ePrice.MAX
                    Return response.Result.Item(0).BuyOrders.Max
                Case ePrice.MIN
                    Return response.Result.Item(0).BuyOrders.Min

            End Select

        Case eTransaction.SELL

            Select Case TypePrice

                Case ePrice.AVG
                    Return response.Result.Item(0).SellOrders.Average
                Case ePrice.MAX
                    Return response.Result.Item(0).SellOrders.Max
                Case ePrice.MIN
                    Return response.Result.Item(0).SellOrders.Min

            End Select

    End Select

End Function

``