BSKGetCategoryMemberByWeight

Module: BSKCategory
BSKCategoryMember* BSKGetCategoryMemberByWeight( BSKCategory* category, 
                                                 BSKUI32 weight );
Inputs: Returns: the category member occupying the given weight in the category, or 0 if no such member exists.

Description: Searches the given BSKCategory object for the BSKCategoryMember at the given "total" weight. A member item's 'total weight' is the range of numbers starting at the sum of all previous item's weights to that value plus the member item's weight.

For example, if a category contained 4 items, weighted 2, 3, 1, and 4, the total weight would be 10. The first item occupies the weights from 1 to 2, the second from 3 to 5, the third occupies only weight 6, and the last item occupies the weights from 7 to 10. If a weight of 5 were passed to this function, the second item would be returned (as it occupies the weights from 3 to 5). Likewise, if a weight of 8 were passed in, the fourth item would be returned (occyping weights 7 to 10).

Return to the API
Return to the function listing


Last updated on 9 Feb 2001 by Jamis Buck (minam@rpgplanet.com)